Combining LazyLoad and Jquery Masonry

后端 未结 6 1142
耶瑟儿~
耶瑟儿~ 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 20:57

    Try to re-use "Masonry" in the "callback_loaded" of the LazyLoad

    var ll = new LazyLoad({
        elements_selector: "img[data-src]",
        callback_loaded() {
            masonry = new Masonry(grid, {
                itemSelector: '.img-selector',
            });
        }
    });
    

    Further added code is below

    callback_loaded() {
        masonry = new Masonry(grid, {
            itemSelector: '.img-selector',
        });
    }
    

提交回复
热议问题