简体   繁体   English

VVO Lazyload在页面加载时加载所有图像

[英]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. 我从很长时间以来就在VVO http://vvo.github.io/lazyload/上使用lazyload,但是对于此特定页面,我不知道出了什么问题。 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 该网站的主页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. 横幅下方有3行产品,其中最后2行的产品图像应仅在页面滚动上被延迟加载。 But still it loads all images on page load 但是仍然会在页面加载时加载所有图像

On page scroll you might be loading dynamic elements from AJAX. 在页面滚动中,您可能正在从AJAX加载动态元素。 VVO Lazyload - lzld(this) will not work form dynamic elements be default. VVO延迟加载-lzld(this)在默认情况下无法使用动态元素。

You have to manually call lzld(imagelement) again for dynamic elements. 您必须再次为动态元素手动调用lzld(imagelement)。

Example:- 例:-

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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