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

后端 未结 7 1954
一个人的身影
一个人的身影 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:29

    There is another option to solve this issue. You have to use another one js if your grid-item contain any image. below the js link is

    
    

    Then call this placeholder js below:

    /*=============Code for Masonry Gallery ==============*/
        var grid = document.querySelector('.grid');
        var jQuerygrid = jQuery('.grid').isotope({
            itemSelector: '.element-item'
        }); 
        var iso = jQuerygrid.data('isotope');
        jQuerygrid.isotope( 'reveal', iso.items );
    
        imagesLoaded(grid, function(){
            iso.layout();
        });
    

    You can get full and clear details from isotop's official website. link

提交回复
热议问题