Combining LazyLoad and Jquery Masonry

后端 未结 6 1158
耶瑟儿~
耶瑟儿~ 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:14

    The reason is that Masonry needs to know the dimensions of the image in order to lay out the items properly. However LazyLoad delays loading the image until the image is in the viewport, meaning that the image will have no dimensions (or have the dimensions of the dummy/placeholder image you set as the img src).

提交回复
热议问题