Abhinav
Abhinav

Reputation: 3428

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

Upvotes: 1

Views: 162

Answers (1)

Bala
Bala

Reputation: 973

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); });

Upvotes: 0

Related Questions