缓存的图像再次在Lazyload中加载 [英] Cached images loaded again in Lazyload

查看:74
本文介绍了缓存的图像再次在Lazyload中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在这里使用lazyload http://bloghutsbeta.blogspot.com/2012/03/testing-2_04.html lazyload与流沙jquery结合使用.而且由于流沙需要回调,因此针对懒惰的回调函数也添加到了流沙(就像您单击"Bicycle","Motorcycle"等按钮一样,然后流沙需要回调"函数)这是回调函数:

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?

请不要告诉我使用其他jquery代替lazyload或quicksand,因为这对我来说不是一种选择

推荐答案

一次又一次显示加载没有问题. (图片已缓存,因此没有其他要求)

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.

这篇关于缓存的图像再次在Lazyload中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆