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

问题描述

我对jquery还是很陌生,试图弄清楚如何为jQuery Cycle Plugin预先加载图像.

I’m quite new to jquery and trying to figure out how to preload images for the jQuery Cycle Plugin.

我有5张以上的大尺寸图像,在使用Cycle插件开始幻灯片放映之前,我需要预先加载这些图像.另外,我还需要显示一个加载gif,以便它可以预加载图像.

I have 5+ large size images and I need those to be preloaded before starting the slideshow with Cycle plugin. Also I need to display a loading gif wile it preloads the images.

我已尝试在此处实施该技术 http://jqueryfordesigners.com/image-loading/

I have tried to implement the technique here http://jqueryfordesigners.com/image-loading/

但仍然不知道如何使其与Cycle插件一起使用.

but still couldn’t figure out how to make it work with the Cycle plugin.

有人可以帮我吗?

谢谢

推荐答案

...或者如果您遇到的是图像过渡之间的暂停,请将此参数添加到循环功能中.它使循环忽略非img内容,例如空格和换行符,这会导致循环在转换之间暂停.

...or if what you are experiencing is a pause between image transitions, add this argument to the cycle function. It makes cycle ignore non img content, such as whitespace and linebreaks, which can cause cycle to pause between transitions.

jQuery('.imageslideshow').cycle({
    slideExpr: 'img',
    // other options
});

这篇关于预先为jQuery Cycle Plugin加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 12:35