Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery Isotope option for auto height on element

So I'm using the isotope masonrylayout

$('section').isotope({itemSelector:'article',layoutMode:'masonry',transformsEnabled: false, animationEngine: 'jquery',masonry:{columnWidth:8}});

The problem is that if I don't set the height for the article in css, the layout doesn't look good the items overlap and stuff, but I can't set a fixed height for the elements, since they are blog posts and can change in size, do you guys have any tips on how to solve this?

like image 500
Uffo Avatar asked Apr 15 '12 16:04

Uffo


2 Answers

Problem solved, you need to call $(window).load instead of $(document).ready(

like image 165
Uffo Avatar answered Oct 26 '22 14:10

Uffo


var $container = $('#container').imagesLoaded( function() {
  $container.isotope({
    // options
  });
});

See Isotope - imagesLoaded

like image 23
desandro Avatar answered Oct 26 '22 14:10

desandro