Skip to content Skip to sidebar Skip to footer

How To Get Isotope To Avoid Gaps With Variable Size Tiles

Is there a way to get isotope to order the grid in the way that there are no gaps? I see the elements changing places in few of the demos but can't achieve the effect myself. Like

Solution 1:

I ended up writing my own extension (perfectMasonry) which does not leave gaps, but instead lays out perfect "brick wall". :) I'll try to publish it (GitHub, mayhaps) as soon as I get some free time to clean it up.

Edit: Here be the perfectMasonry extension: https://github.com/zonear/isotope-perfectmasonry


Solution 2:

If you look at this fiddle and that screenshot - while observing the numbers in your divs - you see that the next masonry element up (the red element 5) can not possibly fit in the white square as it must come after element 4; so where it must end up means, that, with only three rows fitting, you'll get a white gap. Maybe you can use Isotope's shuffle and reLayout methods and sacrifice ordering your elements in a strict order?


Post a Comment for "How To Get Isotope To Avoid Gaps With Variable Size Tiles"