is it possible to disable lazyload (so all images gets loaded..)?
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 al开发者_如何学运维so 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.
Or you could just trigger the event you configured Lazy Load in the first place with.
$("img.lazy").lazyload({
event : "click"
});
$("img.lazy").trigger("click");
This definitely will stop the 'lazyload' - but at a formidable cost to your website performance. You may want to consider defining the image Holders with a height instead - that will keep the place-holder positions accurate and still retain lazyload functionality.
精彩评论