简体   繁体   中英

VVO Lazyload loads all images on page load

I am using lazyload by VVO http://vvo.github.io/lazyload/ from quite a time but for this specific page I don't know what is going wrong. It loads all images when page loads, which are supposed to be lazy loaded. On other pages of website it is working fine.

I have even tried using custom initialization, changing offset and viewport container but no use. My document is also not automatically scrolling on page load.

Problem is happening on this website's home page Winni.in

Below banner there are 3 rows of products, out of which last 2 row's products images should be lazy loaded only on page scroll. But still it loads all images on page load

On page scroll you might be loading dynamic elements from AJAX. VVO Lazyload - lzld(this) will not work form dynamic elements be default.

You have to manually call lzld(imagelement) again for dynamic elements.

Example:-

// Add following code inside AJAX success function $('#dynamic_content img').each(function(index,element) { lzld(element); });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM