本文介绍了在Fancybox2画廊中预加载下一张图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Fancybox2画廊中预加载下一张图像,但是我不知道是否可能.我知道如何通过创建一个新的Image()对象并设置src属性来预加载和图像,但是我不知道我应该使用哪个Fancybox回调.是否有人知道启动或结束显示当前图像时触发了哪个Fancybox事件?

I would like to preload the next image in a Fancybox2 gallery, but I don't know if that's possible. I know how to preload and image by creating a new Image() object and setting the src attribute, but I don't know which Fancybox callback should I use.Does anyone know which Fancybox event is triggered when it starts or it finishes displaying the current image?

因此答案是:只需使用2.0.5及更高版本即可利用preload设置,该设置默认情况下会预加载3张图像.

So the answer is: simply use 2.0.5 and above to take advantage of the preload setting, which preloads 3 images by default.

推荐答案

fancyBox2,因为v2.0.5具有选项preload-要预加载的图像数量,默认情况下会预加载3张图像

fancyBox2 since v2.0.5 has an option preload - number of images to preload and it preloads 3 images by default

这篇关于在Fancybox2画廊中预加载下一张图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 13:23