jQuery Isotope Tutorial

I love jQuery Isotope from Metafizzy. As a longtime fan of the Springfield Isotopes, who wouldn’t love an isotopes jQuery plugin? I’ve enjoyed it so much that I bought the developer license so I could use it for my own commercial applications and themes. It’s an outstanding plugin and a lot of the popular templates and themes on sites like Theme Forest use it to create things like filterable portfolios or display content in other dynamic ways.

The Isotope homepage is awesomely flashy and shows some slick implementations on how you can use the plugin. However, because there is a lot going on there on the page, I think there’s the potential that it might be a bit challenging for users who are new to jQuery to find the simplest way to use it in the code examples. There is a lot of styling and code to sift through. Perhaps, it comes down to a matter of personal preference, but I’m more of a fan of the “Start really simple and plain and then build up from there” approach. So I thought I’d show a really simple, very vanilla example of jQuery Isotope so that you can get it up and running in your own applications as soon as possible. You can add more complexity and styling from there if you so desire. The demo of what we’ll be creating and the corresponding download are below…

View Demo Download Files

We’ll be creating a filterable portfolio-style implementation using jQuery Isotope.

So let’s start by downloading jQuery Istotope from GitHub. From there we can grab the .js file and include it in our project like so…

<!DOCTYPE html>
<html>
<head>
<title>jQuery Isotope</title>
<link rel="stylesheet" href="css/style.css">
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="js/jquery.isotope.js" type="text/javascript"></script> 
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html> 

Next we are going to want to add the following JavaScript to our page in-between the <script> tags in the markup…

$(window).load(function(){
    var $container = $('.portfolioContainer');
    $container.isotope({
        filter: '*',
        animationOptions: {
            duration: 750,
            easing: 'linear',
            queue: false
        }
    });
    $('.portfolioFilter a').click(function(){
        $('.portfolioFilter .current').removeClass('current');
        $(this).addClass('current');
        var selector = $(this).attr('data-filter');
        $container.isotope({
            filter: selector,
            animationOptions: {
                duration: 750,
                easing: 'linear',
                queue: false
            }
         });
         return false;
    }); 
});

We’re attaching the jQuery to the $(window).load event so that Isotope can calculate widths correctly based on the image sizes. Basically, we have 2 “sections” of jQuery here. The first section is necessary for us to initialize Isotope on our page and define the container that’s in it. Then we have what will be our filter for categories and we have our click event tied to $(‘.portfolioFilter a’).

Create a folder called “css” and add a style.css file. Add the following CSS to it…

body {
    font-family: Arial;
}
.portfolioFilter a { 
    margin-right: 10px; 
    color:#666;
    text-decoration:none;
}
.portfolioFilter a.current { 
    font-weight:bold;
}
img {
    margin:5px;
}
.isotope-item {
    z-index: 2;
}
.isotope-hidden.isotope-item {
    pointer-events: none;
    z-index: 1;
}
.isotope,
.isotope .isotope-item {
  /* change duration value to whatever you like */
    -webkit-transition-duration: 0.8s;
    -moz-transition-duration: 0.8s;
    transition-duration: 0.8s;
}
.isotope {
    -webkit-transition-property: height, width;
    -moz-transition-property: height, width;
    transition-property: height, width;
}
.isotope .isotope-item {
    -webkit-transition-property: -webkit-transform, opacity;
    -moz-transition-property: -moz-transform, opacity;
    transition-property: transform, opacity;
}

Here we are using CSS3 transitions to make the filter effect.

Lastly of course we would not want to forget our markup. Add the following code after the opening <body> tag in the markup…

<div class="portfolioFilter">
    <a href="#" data-filter="*" class="current">All Categories</a>
    <a href="#" data-filter=".people">People</a>
    <a href="#" data-filter=".places">Places</a>
    <a href="#" data-filter=".food">Food</a>
    <a href="#" data-filter=".objects">Objects</a>
</div>
<div class="portfolioContainer">
    <div class="objects">
        <img src="images/watch.jpg" alt="image">
    </div>
    <div class="people places">
        <img src="images/surf.jpg" alt="image">
    </div>	
    <div class="food">
        <img src="images/burger.jpg" alt="image">
    </div>
    <div class="people places">
        <img src="images/subway.jpg" alt="image">
    </div>
    <div class="places objects">
        <img src="images/trees.jpg" alt="image">
    </div>
    <div class="people food objects">
        <img src="images/coffee.jpg" alt="image">
    </div>
    <div class="food objects">
        <img src="images/wine.jpg" alt="image">
    </div>	
    <div class="food">
        <img src="images/salad.jpg" alt="image">
    </div>	
</div>

The important pieces (as you can see) are in the data-filter attribute in the filter and in the classes of the container. Notice how the classes in the container match the data-filter attribute in the filter. These values need to match exactly and this is, in essence, how you categorize the objects using Isotope. If you want to put objects into a particular category, you simply need to add the classes that you want and separate them by spaces. Some objects can have one category, some have multiple categories.

Now, this might seem like an ugly unstyled package right now, but this gives you all of the basics to build off of from here. You can now add the elements to it that you need to make it fit with both your front-end framework and your theme styles. You’ll probably also want to update your category names and use your own image, but this should be a good starting point.

9bit Studios E-Books

Like this post? How about a share?

Stay Updated with the 9bit Studios Newsletter

165 Responses to jQuery Isotope Tutorial

  1. Bob Rast

    May 1, 2013 at 2:35 pm  
    Thanks for the demo! I'd like to use three instances of isotope, each in a separate tab. The first instances works fine; the other two are all collapsed in a jumble. I can't figure out how initiate each separately. Any ideas?

    • May 1, 2013 at 4:00 pm  
      Hey there Bob-- Probably the easiest way to have a second and third one would be to just add your other container classes to the $container variable (separated by commas).
      var $container = $('.portfolioContainer, .anotherContainer, .yetAnotherContainer');
      
      All would be controlled by the same filter in this scenario. If you wanted to have separate filters, you'd have to specify those individually.
      • Auguste

        October 9, 2013 at 9:03 am  
        How would that be done individually?

      • October 10, 2013 at 5:49 pm  
        Hi Auguste -- In that case you'd need 3 separate container variables
        var $containerA, $containerB, $containerC
        that you call isotope on. You're going to have to call each container on window.load anyway buy you could probably look at adding a generic filter class for the click event and get the correct corresponding container from somewhere else contextually (like the id attribute).
    • david

      March 29, 2015 at 8:29 pm  
      thanks
  2. ACott

    June 7, 2013 at 7:04 am  
    Nice.. I got this to work nicely, but to my suprise it doesn't work in Opera brower (v11.62).. even the demo site doesn't work.. Any suggestions how to get it to work? Thanks!
    • ACott

      June 7, 2013 at 7:11 am  
      No worries... just upgraded to latest Opera and all is fine..v11.62 is now old!

    • June 9, 2013 at 7:05 am  
      Nice! Glad that it worked out. :)
  3. vishnu

    June 27, 2013 at 2:10 pm  
    Hi, please tell me how to assign the margin between two isotope-items.?

    • July 6, 2013 at 10:46 am  
      Hi there vishnu -- The margin is applied on the image in the css if you look in the demo files...
      img { 
      margin:5px;
      }
      Hope that helps!
      • Thomas

        February 4, 2014 at 8:00 am  
        I was just trying out your excellent tutorial, and i was wondering how to remove the empty space between the isotope items vertically if you set "margin: 0px;" ? Thanks for the good work!
      • Thomas

        February 4, 2014 at 8:58 am  
        Fixed it myself, added in the css-file, img { vertical-align: bottom; }. Yay!
  4. Matt

    July 16, 2013 at 12:07 pm  
    Thanks a lot for the clear and straightforward tutorial--much appreciated!

    • July 17, 2013 at 3:36 am  
      You are welcome Matt
  5. Jamie

    July 17, 2013 at 4:36 am  
    Hi Ian, great job on this! How would one go about making the 'People' category and it's images the default gallery that people see when landing on the page? I've tried moving the class="current" however all the images are still visible when landing on the page! Many thanks!

    • July 17, 2013 at 5:59 am  
      Hi there Jamie! Moving the class is the first step, but in the jQuery you'll also want to change filter: '*' to filter: '.people'
      • Joao Pulcherio

        April 3, 2014 at 1:12 am  
        I have changed the filter value from "*" to ".all" because i wanted to start the load with just some images that contain the word all. I hope you can help me. Many greetings from Germany Ps: Great job I really like it!!

      • April 5, 2014 at 9:28 am  
        Hi there Joao -- What issue are you experiencing where it is not working for you?
  6. marcelo

    July 17, 2013 at 1:12 pm  
    Muy buen recurso, te juro que había querido realizar esto hace mucho y no lo lograba (en Wordpress) pero ahora WOOOOOOOOW muy buen trabajo. gracias !!!!!!

    • July 17, 2013 at 2:00 pm  
      Thank you! You are welcome. And many thanks to Google Translate as well.
  7. mat

    July 29, 2013 at 5:49 am  
    Hi, we had a wordpress themes working with isotope and we need help with it... maybe you'll know what to change! We have a portfolio of pictures 4colums/3 lines with different categories all/edition/logo... but the all pictures are on 3different pages. we can navigate between pages under the images and when we select a category it filters only the pictures on the page where we are! do you think there's a way to filter the all pages and sort the result on the first one? Don't know if i'm clear my english is probably not so good! thanks by the way if you can help!

    • July 29, 2013 at 9:13 am  
      Hi there mat-- There is definitely a way to handle that and it probably involves digging into your WordPress code because it's likely that's what is doing the pagination. Do you have a link I can take look at? You can send by e-mail via the contact page.
    • Guillaume

      December 3, 2013 at 8:27 am  
      Hello, any solution? I have exactly the same problem...
  8. mat

    July 29, 2013 at 6:47 am  
    well thanks....
  9. arfa

    August 3, 2013 at 3:02 pm  
    Totally agree with the "start small and grow" approach. The plugin is awesome - my brain a little less flashy. I have just begun and this is a great beginning thank you
  10. arfa

    August 3, 2013 at 3:13 pm  
    PS - for some reason I can't spot your css provided above doesn't activate transition. I pulled the css source from your demo and it works? Currently can't spot the difference.
  11. arfa

    August 3, 2013 at 6:04 pm  
    3rd css declaration above - font-weight:bold; has no closing } - sweet as.

    • August 4, 2013 at 7:07 am  
      Good catch arfa! Thanks for pointing that out. Change has been made.

  12. August 3, 2013 at 6:53 pm  
    Thank you. Seriously thank you. Isotope's documentation is a total nightmare and assumes you already understand the fundamentals, and this was exactly what I needed to get started :)

    • August 4, 2013 at 7:05 am  
      No problem, Meg! Glad you found it helpful :)
  13. marcus

    August 13, 2013 at 3:35 am  
    Hiya great tutorial any idea how to get a 0px margin on width and height for the images?

    • August 15, 2013 at 9:54 am  
      Hi Marcus. The margin is applied on the image in the css if you look in the demo files...
      img { 
      margin:0px;
      }
      Hope that helps!
  14. Martin

    August 21, 2013 at 9:40 am  
    Hey, very helpful guide - I shall buy you a coffee later on. Any tip on what to google to learn how to expand this and populate pulling info from mysql..? Regards, Martin

    • August 23, 2013 at 4:29 pm  
      Thanks Martin. If you've got the paths to your images stored in MySQL you can just query what you need to and loop through the results and build the markup on each iteration. If you're talking about hitting an endpoint via an AJAX request, there is some good info in the Isotope docs on how to append dynamic content
  15. Esteban

    August 28, 2013 at 12:58 pm  
    Hi!, nice work btw. I have a question, what if instead of images I want to use divs?, I tried it but it doesn't seem the same like the config as the ones who uses images.

    • August 30, 2013 at 11:33 am  
      Hi there Esteban-- Could you perhaps elaborate a bit further? In the example, Isotope *is* acting on the <div> elements. The images are just placed within them.
  16. musheli

    September 7, 2013 at 8:06 am  
    Hi, can please let me know how can I extend the filtering with a text searcht like this example: http://papermashup.com/demos/jquery-list-filter/ but not as a list. I want to have the filter result in a container.

    • September 8, 2013 at 6:46 am  
      Hi there musheli...Could you specify a bit further on what you mean by "I want to have the filter result in a container."? Do you mean you'd want to filter results depending on what the user enters in a text field? If that were the case, you'd need to call isotope not on the click of the categories, but the text change in the field (and you'd also probably have to parse what is left in the filter and pass that information in).

      • December 20, 2013 at 9:35 am  
        Howdy, I too am looking for a text search function where a user can type in any number of keywords and have the related items appear. I'm not too good with jQuery, so what exactly would this look like? I get what I need to do, I just have no idea how to do it. ps thanks again for this tutorial. So, so helpful!
  17. Andres

    September 7, 2013 at 2:25 pm  
    Hi! This is an amazing tutorial!! I have a little question: how can I overlay text to each image? Thanks a lot!!

    • September 8, 2013 at 6:51 am  
      Hi Andres. Thanks! Overlaying text for each image wouldn't be any different here than it would be from how you'd do it in any other situation in web development. You could add another <div> around each image and position the text where you wanted to with CSS. As long as your added content is inside the outer <div> elements that isotope is acting on, you should be in good shape.
      • Andres

        September 18, 2013 at 10:26 am  
        Thanks loads. I have another question: Is it possible to combine the filtering effect with the infinite scroll? Bye!!!!
  18. Pieter

    September 18, 2013 at 7:09 am  
    Waaw, thanks a lot! Works like a charm!
  19. SuitFits

    September 21, 2013 at 5:55 am  
    Hi, thanks so much for helping out. I would like to ear tour opinion on setting a squared isotope. Supose I want a 60x60 square portfolio / txt widgets. Where should I target the fixed height and width in px ? The inline IMG ? div through CSS? img through CSS? Well to be honest I want build squared elements with a number on center, clickable. Still to decide if I'm going to use images for simulating my text boxes, or real anchor (link) properly centered inside de isotope. Visually, its like rows of numbers inside color isotopes that I would like them to do on something when clicked. Can you give me your opinion on how to achieve a squared element? inline or css or both?
  20. santosh

    September 22, 2013 at 10:32 pm  
    Thanks for this demo............

    • September 24, 2013 at 4:27 am  
      You are welcome! :)
  21. Chris

    September 24, 2013 at 7:15 am  
    Thanks for this. I have been looking for something that is simple and easy to understand! Great work. Thanks!
  22. Ville

    October 1, 2013 at 9:39 am  
    Thanks for this tutorial. How I should modify this if I have two independent image galleries with their own filters on same page? I can get the filtering to work for one set of images. I have 2 containers and 2 sets of filters with unique IDs. Thanks!

    • October 2, 2013 at 6:18 am  
      Hi there Ville -- You could the duplicate jQuery code and change the names of the container selectors and filters, but I would look at pulling things into a separate function that you could call in the body of the click event where you specify the container that maps to whatever filter was clicked. You might have to adopt some sort of naming convention to conditionally determine which container you want apply Isotope to.
  23. Yomero

    October 2, 2013 at 2:12 pm  
    Thanks dude, I was looking for a way to change the first page to avoid "All Categories" and show an independent section as a first category, and your load function helps me a lot.
  24. pow

    October 10, 2013 at 7:57 am  
    This almost cracked my head! No animation worked for me. Then I found this: http://stackoverflow.com/questions/6283977/jquery-isotope-masonry-layout-animation-failing

    • October 10, 2013 at 5:54 pm  
      Yeah you could go that route as well. This example uses CSS3 which is included in the tutorial. I think that in general you're probably going to get a bit better performance out of CSS3 if that is something that is a priority for your web page or application.
  25. Jakub

    October 13, 2013 at 10:17 am  
    Yo, i have done everything like u write also with this code but dont work... I have category pics but ni animation
  26. murph

    October 20, 2013 at 2:42 pm  
    Thanks for the tutorial. Isotope's site isn't helpful for beginners so this is great. Im trying to acheive one thing and need help - how can I build this so it will allow images of different widths and heights? I can make the images all different multiples of one size, if that helps, but have no idea how to build this gallery to enable different sizes. Thanks in advance :)

    • October 22, 2013 at 10:26 am  
      Hi there murph -- Glad you found it helpful! Could you perhaps explain a bit further what you mean? There's nothing in the CSS or JavaScript that forces the images to be the same size. If you use images of different sizes it will still work. They may not filter nicely into 2 perfect columns but all the functionality will still be there.
  27. Micaela

    November 7, 2013 at 5:56 pm  
    Hello, great this demo. A question, ¿is possible to put a link on a outside page and go directly the filter selected? thanks!

    • November 11, 2013 at 7:19 am  
      Hi there Micaela -- You could. You'd have to pass the filter name in as a GET parameter in the query e.g. yourwebsite.com?filter=people
  28. Kerk

    January 7, 2014 at 6:26 am  
    Hi there, not sure how can i center all the div? i tried "margin: 0 auto;" but it doesn't work. Thanks!

    • January 10, 2014 at 7:02 am  
      Try putting a wrapper div around all of the content and doing margin:0 auto on that. Your div will have to have a width property defined.
  29. James

    January 31, 2014 at 12:35 pm  
    Hi, Thanks for the amazing tutorial! Is there a way to change which category loads by default when you click a certain link. e.g. in the navbar you have seperate links for people, places, food and objects and each one open the respective category by default.

    • February 1, 2014 at 6:10 am  
      Hi there James. The filter property is what does the filtering so you could change the default on page load like so..
      var $container = $('.portfolioContainer');
      $container.isotope({
          filter: '.people',
          animationOptions: {
              duration: 750,
              easing: 'linear',
              queue: false
          }
      });
      
      You'd have to change which class is current to start out with in the filter by modifying the HTML. Another option would be to trigger a click on of the filter items using jQuery trigger on the $(document).ready event.
      • James

        February 2, 2014 at 5:18 am  
        $(document).ready(function () {
            if(window.location.href.indexOf("scratch") > -1) {
                $("#scratch").trigger('click');
            } else if (window.location.href.indexOf("games" > -1){
                $("#games").trigger('click');
            } else if (window.location.href.indexOf("apps" > -1){
                $("#apps").trigger('click');
            } else if (window.location.href.indexOf("other" > -1){
                $("#other").trigger('click');
            }
        });
        Why doesn't this work at the start of the page??? The code I am using is here: http://jsfiddle.net/GwBa8/128/ Thanks again :)

      • February 8, 2014 at 6:25 am  
        Hi James -- What specifically is not working? The code at the link you posted looks okay to me. Is your #tag in the actual URL when the page loads?

  30. February 3, 2014 at 9:49 am  
    Hi, Thanks for the cool tutorial, it might be a bit of a faff here but would you also know how to also make the images fluid/responsive? I've looked about the net but i can't really find a good solution Thanks,
    • wueins

      February 10, 2014 at 9:45 am  
      Hey there, I'd like to know that too! Anyone who could help? Thanks (also for the great tut)!

    • February 11, 2014 at 7:49 am  
      Hi there Noah -- I'd say you'd probably just do as you normally would by setting responsive properties on the images...
      img {
          max-width: 100%;
          border: 0;
          -ms-interpolation-mode: bicubic;
          vertical-align: middle;
      }
      If you scale down to portrait view you can see this take effect. Because the images are absolutely positioned, for most cases you'd want to make sure that the container
      holding them is responsive, and then the items will fit themselves in that space as things scale down.
  31. Deb

    February 18, 2014 at 11:34 am  
    Is there a way to get the grid to center on smaller screens? I am building a responsive site and I love that everything shifts and reorders when the screen narrows but I would like the image grid to center within the main .portfolioContainer on narrower screens. Otherwise I am left with a blank area on the right when viewed on some screens...

    • February 21, 2014 at 7:02 am  
      Hi there Deb -- You'd probably have to wrap the portfolio container in a fixed or percentage-based width and then use margin: 0px auto; If you threw it into a CSS grid like Zurb's Foundation or Twitter Bootstrap, you could see how they'd do it with their rows and columns.
  32. K RAVI

    March 11, 2014 at 7:36 am  
    Thanks very much for your simple code. It was very very useful.
  33. Michelle

    April 11, 2014 at 5:10 am  
    Got this to work perfectally thanks. Is there any way of disabling the transition where the images have to load before they slide down to fill the page? I have a lot of images in the page and it loads all the images before sliding down the page. Is there an option of taking this transition off? if so how do I do it. I hope this makes sense. Thanks.

    • April 15, 2014 at 6:23 am  
      Hi Michelle -- Most likely there is a way to accomplish this but I'm not sure what it is off the top of my head. It would probably involve hiding the container that holds the images and then displaying it in a callback function once isotope runs through its layout logic. The other option would be to perhaps try to load the images asynchronously.
  34. Nathaniel

    April 11, 2014 at 8:53 pm  
    Hi, great tutorial, I have been looking for one thats not a plugin, anyways, I cannot seem to get it to show different images when clicked on different options, it only shows them when I'm viewing all, but if i go into sub categories it doesn't show them, and I am wondering how to get it fixed.

    • April 15, 2014 at 5:44 am  
      Hey there Nathaniel -- Thanks! Did you download the files and start from there or did you build it from the ground up? If you download the provided files I'm fairly sure things should work for you out of the box. If not, so you have a URL I could look at to see what might be going on?
  35. vicky

    April 23, 2014 at 4:47 am  
    what is the parameters in isotope jquery? and where it is?

    • April 26, 2014 at 6:41 am  
      Hi vicky -- I'm afraid I'm not entirely understanding your question. Could you perhaps be a bit more specific?

  36. May 2, 2014 at 7:51 am  
    Oh God. Thank you, thank you, thank you! I've been fighting with Isotype for about 8 hours straight... I'm a designer, not a coder. Couldn't see the forest for the tress. Now it's simple. You are amazing.

    • May 3, 2014 at 7:07 am  
      Thanks Dave. Glad that I was able to help out.
  37. kim eChic

    May 5, 2014 at 2:13 am  
    Thanks, this was a life saver. Can you explain how to specify the layout mode, eg.g masonryHorizontal, or cellsByRow? I tried adding layoutMode: 'masonryHorizontal', before the line filter: '*', but that clearly wasn't right.
  38. pierre

    May 15, 2014 at 3:47 am  
    Thank you so much from France ! You helped me a lot.
  39. Justin

    May 21, 2014 at 11:10 am  
    Is there a way to set a maximum number of visible items per filter? Or can it be amended to do so? The background is I'm using this for categorized events and want a single (but full) row of 6 items to show the next 6 events for each category, but still only want to show 6 when data-filter="*". Thanks, Justin

    • May 24, 2014 at 8:15 am  
      Hey there Justin -- I haven't had a chance to look into this specifically in-depth but I did a quick search and some of the Stack Overflow answers seemed to recoomend using the nth of type selector e.g. filter: ':nth-child(-n+6)' to get the first six results...
  40. Shavonne

    May 27, 2014 at 11:00 pm  
    Is it possible to use Isotope and still have lightbox images? I'm having trouble finding a filter system where I can still use lightboxes.

    • May 30, 2014 at 7:39 am  
      Hey there Shavonne -- Do you mean that you want to show the images within isotope in a popup like Fancy Box or Pretty Photo? Could you attach a click event for one of these plugins to each image?
    • DanR

      June 19, 2014 at 11:01 am  
      I got it to work with Lightbox2 but had to deal with the jQuery/prototype.js conflict to get the script to work. Thanks, Ian, for your tutorial. REALLY helpful.

  41. June 4, 2014 at 2:22 am  
    Hi, Ian. Your tutorial is great, however I have an issue with Isotope. When it is uploading the space is stretched as there are no images, once uploaded it expand. Now, how ca I avoid that, as it pushing my content down after downloading. I hope this make sense. Cheers

    • June 7, 2014 at 7:09 am  
      Hi there Maribel.. I'm having a little bit of trouble envisioning what you are describing specifically. Is there perhaps a demo URL I can take a look at?
  42. Markus

    June 20, 2014 at 2:45 pm  
    Hey Ian, I've tried setting up the isotope for quite a while without having much knowledge in js. Do the elements have to be in div-containers to be sorted? Please have a look @ goo.gl/kPBELj - I'd love to create a menu that sorts the thumbs by category [logo, animation etc.] Thanks for your help.

    • June 25, 2014 at 5:22 am  
      Hey there Markus -- Sorry for the delay in response. I took a look at your link and it looks like things are working pretty well. Is there anything you are wanting to accomplish beyond what you have done so far?
  43. handoyo

    June 28, 2014 at 10:13 am  
    Hi,i would like to ask if it's possible to filter decimal numbers in isotope?thanks alot.

  44. June 29, 2014 at 4:11 pm  
    Hi, Ian. Thank you for the amazing tutorial, i'd like to know if there is any way to insert a 'Load more' option after like 12 contents for each category. Plz take a look on this page: http://rec-torrents.com/filmes/ Thanks for your help!!

    • July 3, 2014 at 8:40 am  
      Hey there Rafael...

      If you were to add a link with class="loadMore" after the container, you could add something like the following to append items on the click event...

      var newItems = $('<div class="objects"><img src="images/watch.jpg" alt="image"></><div class="people places"><img src="images/surf.jpg" alt="image"></div>');
      $('.loadMore').on('click', function(e){
        $container.append(newItems).isotope('insert', newItems );
        return false;
      });
      
      You'd probably want to pull in different items each time that click event is fired, but that would be more-or-less how you'd do it.
  45. abhishek

    July 15, 2014 at 7:12 am  
    hello, I am binding listview dynamically...datafilter is also dynamic...problem is that when i click on all..its work fine but when i click on other categories..everything hide..i check into firebug and i come to know that isotope-hidden class is applied on all items instead for particular category.. can you help me out???

    • July 24, 2014 at 10:05 am  
      Hey there abhishek... Sorry about the delay in response. I was travelling and did not have access to the Internet for awhile. Do you perhaps have a URL I can look at and perhaps see what might be occurring?
  46. Elliot Holman

    August 13, 2014 at 1:53 pm  
    Just to say thanks alot man, ive been messing around with this for hours now and im getting to point where my patience was wearing a bit thin to be honest. This was just what I needed and I tip my hat to you good sir!

    • August 17, 2014 at 7:48 am  
      No problem Elliot. Glad you found it helpful
  47. Allison

    August 26, 2014 at 3:22 pm  
    I ran into problems with this tutorial. jQuery was undefined, even when it was evident. For anybody who has run into the same problem, please visit the link below for the tutorial that worked for me: http://codepen.io/desandro/pen/nFrte Make sure you have isotope.pkgd.min.js & the latest version of jQuery. Thanks!

    • August 28, 2014 at 6:32 am  
      Hey there Allison -- I just downloaded the demo files and confirmed that things still worked. jQuery is loaded up from jQuery.com so if you're offline then yes, jQuery will end up undefined
  48. Michelle

    August 29, 2014 at 12:39 pm  
    Hi, I was wondering if its possible to show no images at first. In other words the page is blank and when you click on the filters then the images will show up. Thanks!

    • September 1, 2014 at 6:14 pm  
      Hi Michelle -- Could you do this with CSS... display:none; on the images until a click event on the filters? Would that work?
      • Michael Miller

        September 9, 2014 at 11:22 am  
        I was able to do this by adding a filter to script. In this case: filter: 'none', Since none is not a category.
        jQuery(document).ready(function(){
        var mycontainer = jQuery('#content');
        mycontainer.isotope({
        filter: 'none',
        itemSelector: '.song'
        });

  49. September 3, 2014 at 4:25 am  
    I agree with Meg, Isotope's documentation is a "nightmare" and I almost switched back to quicksand. Thanks to you isotope is working! Terrific tutorial. But now with isotope, prettyPhoto isn't working (and I'd like to use it because of the social sharing features). It seems prettyPhoto needs to be initialized through the filtering function of isotope (as it was I believe for quicksand) but have not had success finding good documentation on how to do this. Any suggestions?

    • September 5, 2014 at 8:14 am  
      Hi Cindy -- Thanks for the kind words. Which part of prettyPhoto is not working? the click event? Do you have a URL where I can take a look at what you're trying to do?

      • September 7, 2014 at 2:36 pm  
        Thank you Ian. The site is in development still, but here is the page in question where isotope and prettyPhoto are not playing well together. The isotope initialization (and attempted prettyPhoto trigger function) is at the bottom of the page. Again thank you very much for the assistance. www.ccbcreative.com/temp-new/

      • September 10, 2014 at 6:44 am  
        Hi again Cindy -- You have a script error in the page that might be the culprit. Inside your second $(function(){ }); line 474 $container is not defined because it is not in scope, defined in the first $(document).ready(function() { }); I'm not sure why you are using 2 different document readys, but if consolidate them into one that should resolve the error (which might be the cause of prettyPhoto not working)

      • September 10, 2014 at 1:17 pm  
        Thanks again Ian, OK I will try to define the $container. I did have the functions all under one doc ready file, still was having an issue. I placed in two doc ready scripts when I was testing.
  50. Sarah

    September 8, 2014 at 7:00 pm  
    Just wanted to say thank you. Your instructions made it super easy to setup and provided a great base for me to work with. Thanks again :)

    • September 10, 2014 at 6:44 am  
      No problem Sarah. Glad it was helpful.
  51. vrajesh

    October 4, 2014 at 4:26 am  
    thank you very much that is what i am exactly looking for ....thanks again....

  52. October 17, 2014 at 6:12 am  
    Hi. Im trying to use the jquery isotope tool. Im having issues using multiple instances of it on the same page. The second instance will attempt to filter the items within the first instance. I tried to use your suggestion to Bobrast & Ian at the top of the page but had no luck and ruined the functionality altogether. I've been trying this for close to a week now and Im on the verge of losing my marbles. The example I am working on can be found at: http://www.djr-media.com/gasst/index_video.html within the series sections of the page Any help would be massively appreciated. Thanks in advance, Danny

  53. October 24, 2014 at 3:09 pm  
    Thanks for the demo! My brain was overheating trying to figure it out from the isotope site, you made it very clear.
  54. Fury

    October 28, 2014 at 4:56 pm  
    this is very useful for Isotope v1, if you are looking for an upgrade to Isotope v2 this one provides it with a very simple steps: http://goo.gl/sQ6yXj
  55. Megan

    January 13, 2015 at 2:06 pm  
    Hi - I am trying to use this demo for a project I am working on. Mine works but the images don't line up properly. All of my images are the same size. 190x175 - I have 14. When I put them on the page they line up in 2 rows of 4 and 2 rows of 3. When I filter, there are gaps. Show all manipulates the images in a way that I can't understand making the first image in each row taller than the others. I am fairly new at this but I cannot figure out these discrepancies. Do you think you or anyone can help? Thank you so much!! Megan

    • January 18, 2015 at 8:45 am  
      Hi there Megan -- Do you perhaps have a demo link I could take a look at?
  56. Megan

    January 13, 2015 at 2:16 pm  
    One other question - can an image be in more than one category?

    • January 18, 2015 at 8:48 am  
      Hi again Megan -- Sure, you cab have an image in more than one category. If you look at the current demo the image of the wine is in both the "Food" and "Objects" categories.
  57. christine

    January 26, 2015 at 2:54 pm  
    thank you so much! this was incredibly helpful - by stripping it down to the most basic functions - it helped me better understand how to use this. you rock!
  58. Md. Liakat Ali

    February 1, 2015 at 4:10 am  
    Thanks !
  59. Max

    March 6, 2015 at 6:50 am  
    Hi and thank you for this great tutorial! Is it possible to apply the margin to the div element instead of the image? I tried to but on load all div elements stick together. After using a filter button the margin is applied correctly. At the beginning all images are loaded in one column before they are positioned correctly. Is it possible to change this behavior? Best regards
  60. Coder

    March 6, 2015 at 10:54 am  
    Incredibly helpful. Thanks.

  61. March 10, 2015 at 10:15 am  
    Hey there! I was wondering if there was a way to select multiple filters at once. For example, in the demo, is there a way to select both people and places at the same time, thus filtering the results further? I am not an expert in programming so simpler the better :) Thanks!

    • March 19, 2015 at 9:40 am  
      Hi Nick -- You could do this by separating your different selectors with commas e.g. $container.isotope({
      filter: '.people, .places',
      ...
  62. vinay

    April 1, 2015 at 11:46 pm  
    Hi when change mobile device portrait to landscape portfolio overlapping and height between 2 image blank space. Help Me

  63. May 16, 2015 at 1:48 pm  
    hi is there a way to show 8 items in each filter and use a next button to show next 8 items. i want to do it in each filter separately. thanks

    • May 18, 2015 at 7:09 am  
      Hey there saeid -- I'm sure there is probably a way to do something like this e.g. using the AJAX functionality of the plugin in combination with clearing the container div or removing items, but this would probably take a bit of coding work to put all the pieces together.
  64. slamet

    May 29, 2015 at 2:29 am  
    how to get url params with isotop ?

    • May 30, 2015 at 6:05 am  
      It isn't really something specific to Isotope, more native JavaScript. I wrote a post on it here
  65. Chris

    June 8, 2015 at 5:23 am  
    First, i want to thanks for this script and tutorial. I changed the pictures into text-links and everything works fine. but now i want to change the layout-mode to vertical but i cant figure out how i have to do that. i try it on serveral ways but out luck. thx for any help

    • June 9, 2015 at 6:07 am  
      Hey there Chris -- What do you mean by "change the layout-mode to vertical"?
  66. Mahedi Hasan

    July 1, 2015 at 11:53 pm  
    It's an awesome explanation and after using this one my site looks preety well
  67. Tsu

    July 17, 2015 at 7:27 am  
    Hey, thanks for the tutorial , it works fine however I'm having trouble integrating with Manific Popup. I wrap the image with the portfoliofilter category for eg.
    <a href="#">Code</a>
    <a href="assets/images/Portfolio/a.jpg"></a>
    But isotope doesn't seem to be working here, any ideas?

    • July 18, 2015 at 2:15 pm  
      Hey there Tsu -- I'm not particularly familiar with this plugin but the 2 plugins together shouldn't conflict. Do you have a URL I could look at to see what you are trying to accomplish. I assume you're trying to have the images open in a pop up when clicked?

  68. July 19, 2015 at 4:37 pm  
    I'm unable to get the code working consistently in Chrome or Safari, works as expected in Firefox. Its at the above link After clearing history, it may work, but not always, sometimes the image holders are collapsed, sometimes not... Any ideas?

    • July 20, 2015 at 6:37 am  
      Looks like it works fine for me in Chrome. The only thing I see is that it doesn't look entirely visible when the site first loads, but this is likely due to something occurring somewhere else. You have a number of errors in the console including one that says: Uncaught TypeError: $(...).niceScroll is not a function main.js line 148
  69. Jose Lluberes

    August 13, 2015 at 7:44 pm  
    Hi, thanks for the tutorial. I want to add a 3rd column and i dont know how to do it, could u please help me

    • August 14, 2015 at 7:54 am  
      Hi there Jose -- The number of columns is dictated by the width of the viewport/screen. There is no strict definition for number of columns.
      • Jose Lluberes

        August 14, 2015 at 8:45 am  
        the thing is that i increase the winth and height of an image and... i dont know how to arrange the images, now i have these http://subefotos.com/ver/?2fcb8e2e2599cb1b2ef13454c3bb8b3eo.jpg

      • August 17, 2015 at 6:00 am  
        It looks like you have a bunch of different images sizes which Isotope will try to fit together in sort of a masonry type layout for you but it might not be working exactly right. It's Isotope that does the arranging by absolutely positioning the elements within the container. I don't really have a lot of control over it.
  70. Arjun Menon

    August 27, 2015 at 5:01 am  
    Hi Sir, Thanks for providing a good example.I am trying to implement the same in my project where the controls are created dynamically based on ajax call back using jquery. The class isotope-item & isisotope-hidden are assigned to divs that acts as titles and the latter one is to hide the tiles. Are those classes set dynamically using the isotope reference, because when i implemented in my project those are not coming . Can you please help me out? Thanks Arjun Menon

    • August 28, 2015 at 7:30 am  
      Hi there Arjun -- Those classes are added dynamically by Isotope. Do you by chance have a URL I could take a look at?
      • Arjun Menon

        August 28, 2015 at 9:57 pm  
        Hi sir, Unfortunately it's a localhost website. As far as what i have understood the main div that holds the div will have isotope class , which is coming in my page, but those filter div which i must mentioned are appended dynamically in a ajax call back function are not set the isotope-item class. I have JS reference to jquery-2.1.4.min.js, bootstrap,my 3 custom js files and since the controls are added dynamically i have added them at the end of body tag.I have also added that click binding in document.on event since the controls are created in async process.
  71. Jet Martin

    September 4, 2015 at 9:32 am  
    Thank you for this Post!!!! For the last two days I was struggling to get isotope working...read your post and within 30 minutes it was working perfectly! cheers

    • September 4, 2015 at 6:56 pm  
      No problem Jet. Glad you found it helpful!
  72. Hum Drum

    September 25, 2015 at 1:05 pm  
    Hello, Ian! I'm glad you're still responding to people on this thread. Fantastic work you've done. I'm fairly new to data visualization in this way. So, if you will indulge me, I have a few questions. a. Currrently, the image source is the image. How would I go about making those image-links? Would I just use <a> instead of ? b. Is there a way to set a default image if the post has no avatar or anything? Meaning that I'm pulling data from some link, right? There may or may not be an image there. I want to display an image for which there is none. c. Instead of images, can I filter by text? How would I do that? Thank you very much for your time and consideration!

    • September 26, 2015 at 9:33 am  
      Hey there Hum Drum -- Thank you for your comment. I will do my best to answer your questions. a) You could definitely just wrap the image in an <a> tag. Everything will still work fine. b) There is no specific way to set a default image as far as Isotope goes. If you were, say, getting the results from a database or something like that and there way no image set for that column then you could just put a default placeholder image in that spot instead. c) I don't know if I fully understand what you are wanting to accomplish here. We are actually filtering the <div> elements tht wrap each of the images, so if you put text in the <div> instead, it would still work the same.
  73. Vibhakar

    November 3, 2015 at 8:56 am  
    Very Helpful Article Sir. Thanks a lot. I have implemented it in my project and its working fine. But the portfolio is not responsive

  74. November 10, 2015 at 3:38 am  
    Hi Ian, Thanks for the explanation. My portfoliomenu starts with "all", but I don't need this, so I made the first invisible. I added a filter '.woon', so the portfolio starts with the first category 'woon', which is what I want. But my invisible "all"-category still has the "current" class, not the startup category. Can you help me fix this? thanks ottie

    • November 11, 2015 at 8:04 am  
      Hi there ottie -- Sure we can take a look at it. Do you perhaps have a demo URL I could take a look at? Thanks!
  75. Sabuj

    December 14, 2015 at 8:15 am  
    Hello, I am sabuj Biswas First of fall I want to thanks for you helpful mind. If you don't share it I fall a big problem. I way is so much easy. really really thanks
  76. Tim

    December 23, 2015 at 6:55 am  
    Hello, thanks for this great explanation. I have tried implementing this in my site but it doesnt seem to be working at all. I am getting the following error at console: Uncaught TypeError: $container.isotope is not a function. Care to shed some light on this? I've tried changing the external link different ways but no luck yet.
    • Tim

      December 29, 2015 at 4:20 am  
      nevermind got it working :) it was all about the placements of my javascript library and isotope.js. I put the link to the js library at the top of the file and the isotope at the very bottom.

  77. January 21, 2016 at 4:10 am  
    The moment you access our website you will notice that it loads 3 products in a row but takes time to load all the products then move up all the products because it should be 4 products per row. I wanted by default to load in an instant 4 rows instead of 3. I don't exactly know where to edit it in the javascript. I followed your tutorial as well and very impressive. Now regarding our website it is already set to 4 products per row, it's just that the isotope script is loading 3 first then adjust later after everything is loaded in the webpage. Any help? Thanks!

    • January 22, 2016 at 5:17 pm  
      Hey there phillip -- It's more of a CSS/width of container issue. The items will just fill the space that's available depending on the size of the container and the size of the times. It's not really something you explicitly set in JavaScript.

  78. February 10, 2016 at 11:10 pm  
    You saved me days of work and stress.
  79. Stuti

    March 29, 2016 at 3:40 am  
    Can I Use isotope.js for free in an enterprise Web application which i have downloaded from Git .Or i need to get the Org license

    • March 30, 2016 at 5:13 pm  
      Hi Stuti -- You can use it for free for non-commercial purposes (e.g. on your personal website). If you are using it in a project such as a website for a client or building a theme that you will sell on a marketplace somewhere then you will need to purchase a license.
      • Stuti

        April 18, 2016 at 12:40 am  
        Thanks lan for the reply.Now we are doing a POC .If in our org all liked that POC we will implement it in our internal project for our company.Hope during the POC stage I dont have to buy the License .
      • Stuti

        April 18, 2016 at 7:29 am  
        Infact I am using the isotope.js and css which is attached in your demo.
  80. Jay

    April 14, 2016 at 7:48 am  
    Hi Ian, I was wondering if you could help me. On my website i currently have the isotope gallery installed and everything works perfectly. I would like to show one of my categories first instead of "All" - Is this possible and if so how would i go about doing this?

    • April 15, 2016 at 4:57 pm  
      Hi Jay -- Could you just remove the "All" link from the list at the top and then rename the category to whichever of your categories you want to show first?
  81. Priscila

    April 14, 2016 at 9:03 am  
    mine is not working :( when i click in a link , not working, can you help me? thanks very much!

    • April 15, 2016 at 4:58 pm  
      Hi Priscila -- Did you download the demo package provided? Which OS and browser are you using?
  82. Priscila

    April 16, 2016 at 7:57 am  
    yes i downloaded but animation is not working, when i click on link ,not working, i am using os x, mac and browser is chrome thanks so much!
  83. dalibor

    May 19, 2016 at 1:58 pm  
    hi,I can't put margin around them,when I want to separate them from each other and give the isotope-item margin and space they move all at once,I want them to move one from each other,like real divs tnnnxxx
  84. MD. RUBEL

    May 31, 2016 at 12:57 pm  
    hi sir i'm new.and i want 3 image show.how it's posible and how can i change?
  85. Malsia

    June 3, 2016 at 11:56 am  
    2 Years on from your initial blog, and still, probably the best example of integrating isotope into use.. Thanks for this: When you get a free minute or two, wonder if you could expand and add in the sortby into your example.. coz I'm dun for trying to figure out how to filter and sort.

Leave a Reply