Cached images loaded again in Lazyload

China☆狼群 提交于 2019-12-25 05:12:47

问题


well I am using lazyload here http://bloghutsbeta.blogspot.com/2012/03/testing-2_04.html the lazyload is used as a combination with the quicksand jquery. And as quicksand requires a callback so a callback function for lazyload is also added to the quicksand (as if you click buttons like Bicycle, Motorcycle etc, then quicksand requires callback function) here is the callback function:

$("img").lazyload({
        effect : "fadeIn"
    });
});

Now my problem is that even when all of the images are cached you click e-g on cricket button then it again loads the images, its kind of annoying for users as they load the images and when they click on buttons it loads images again and again as you click on buttons. So, I was thinking what could be solution to it?

Please don't tell me to use other jquery instead of lazyload or quicksand as that is not an option for me


回答1:


There is no problem in show the loading again and again. (the image is cached, so there is no adctional request)

But if you really don't want to show the loading for cached images, you can save the cached images in a array and apply the lazy load in the images that aren't in that array.



来源:https://stackoverflow.com/questions/10235372/cached-images-loaded-again-in-lazyload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!