Combining LazyLoad and Jquery Masonry

后端 未结 6 1131
耶瑟儿~
耶瑟儿~ 2020-11-28 20:47

I have been trying to piece together masonry and moo tools lazyload however they both dont seem to go very well together although it possibly could just be because I am slig

6条回答
  •  执笔经年
    2020-11-28 21:15

    softk5 answer wasn't working for me and causing freeze on the most of browser. Here is my following code and its working for me.

    jQuery(document).ready(function(){
        jQuery("img.lazy").lazyload({
            effect: 'fadeIn',
            effectspeed: 1000,
            threshold: 200,
            load:function(){
                var $container = jQuery('.is_masonry');
                $container.masonry({
                }).imagesLoaded(function() {   $container.masonry();  });
    
            }
        });
    
    });
    

提交回复
热议问题