Cached images loaded again in Lazyload

2019-08-25 05:54发布

问题:

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.