Isotope folded (elements overlap)

Maverick picture Maverick · Dec 19, 2012 · Viewed 8.7k times · Source

I have been reading stack overflow for a solution but can't find it.

enter image description here (full size image at http://i.imgur.com/hrcDg.png)

When I load the page it looks like that

Here is the site (beta)

http://e-gimnazija.hostoi.com/test/site/index.html

If you press all it unfolds, maybe I can solve it if it auto unfolds at the start

Answer

Gabriele Petrioli picture Gabriele Petrioli · Dec 20, 2012

The problem is that when you run .isotope the images are not yet loaded, so the plugin cannot calculate their size..

You have some different options to choose from

  1. Start isotope after the images have loaded.. $(window).load(function(){/*init plugin here*/})
  2. Use the imagesLoaded plugin: http://isotope.metafizzy.co/docs/help.html#imagesloaded_plugin
  3. call reLayout once the images are loaded $(window).load(function(){$('#thumbs').isotope('reLayout');});
  4. if the li elements are fixed size, then give them dimensions through CSS, and isotope will pick them up..