jQuery isotope on first load doesn't work, How do I wait for all resources/images to be loaded?

后端 未结 7 1983
一个人的身影
一个人的身影 2021-01-17 16:57

I\'ve got something I\'ve put together using jQuery isotope here.. http://jsbin.com/eziqeq/6/edit

It seems to work in general but on first load, of a new tab, the Is

7条回答
  •  感动是毒
    2021-01-17 17:24

    Note:
    1.you should call iso-top function inside windwo load event (it will wait for resources to be loaded) also you can call function in footer.

    2.confirm that function call after css load.

    $(window).load(function(){
         $('.iso').isotope({
         // options
         itemSelector: '.item',
         layoutMode: 'masonry'
        });
       });
    

    also can use image preloader plugin for images loading first
    http://www.createjs.com/#!/PreloadJS

提交回复
热议问题