本文介绍了是否可以禁用lazyload(所有图像都被加载..)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站使用



原因是,你可以正常滚动图像,这很好,但我也有导航,你可以跳转到某个图像。现在当lazyload处于活动状态时,浏览器会跳转到错误的位置,我想这是因为lazyload还会加载一些以前的图像,因此故意图像会被取代..



所以我想要禁用lazyload,如果subnavigation是活动的..像unbind ...?
任何机会?



事实是,两种方法都需要工作。比如单击图像时,滚动到下一个图像(并使用lazyload)。但是当激活预览图像(它们被隐藏在前面,所以这是可能的,我猜),停止lazyload并加载所有图像。

解决方案

感谢您停止..
i现在从lazyload机器本身获取了该事件。

  $('#images img')。each(function(){
$(this).attr(src,$(this).attr(original));
});

所以我只是改变图像,就像lazyload本身一样。


i have a site using jquery lazyload

its working fine, but now i want to be able to disable this function.the reason is, that you can normally scroll through the images, which is fine, but i also do have a navigation, where you can jump to a certain image. now when lazyload is active, the browser jumps to the wrong place, i guess thats because lazyload also loads some previous images, so the intentional image gets displaced..

so i want to disable lazyload, if the subnavigation is active.. something like unbind..? any chance?

the thing is, that both methods need to work. like when click on an image, scroll to the next one (and use lazyload). but when activating the "preview images" (they are hidden upfront, so this would be possible, i guess), stop lazyload and load all images.

解决方案

thanks for stopping by..i now took the event from the lazyload machinery itself.

    $('#images img').each(function() {
    $(this).attr("src", $(this).attr("original"));
});

so i just alter the images, like lazyload does it itself.

这篇关于是否可以禁用lazyload(所有图像都被加载..)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 03:53