jQuery循环/增量
我目前正在使用jquery循环插件。我有3个不同的幻灯片,它们彼此相邻,同时循环播放。我想做的是先设置第一个幻灯片,然后设置第二个,然后设置第三个。我是否可以通过增量或超时来实现这一点jQuery循环/增量,jquery,Jquery,我目前正在使用jquery循环插件。我有3个不同的幻灯片,它们彼此相邻,同时循环播放。我想做的是先设置第一个幻灯片,然后设置第二个,然后设置第三个。我是否可以通过增量或超时来实现这一点 <div class="cycle" id="one"> <img src="one.jpg" alt="" /> <img src="two.jpg" alt="" /> <img src="three.jpg" alt="" /> </d
<div class="cycle" id="one">
<img src="one.jpg" alt="" />
<img src="two.jpg" alt="" />
<img src="three.jpg" alt="" />
</div>
<div class="cycle" id="two">
<img src="two.jpg" alt="" />
<img src="three.jpg" alt="" />
<img src="one.jpg" alt="" />
</div>
<div class="cycle" id="three">
<img src="three.jpg" alt="" />
<img src="one.jpg" alt="" />
<img src="two.jpg" alt="" />
</div>
$('.cycle').cycle({
fx:'fade',
speed:1000
});
$('.cycle').cycle({
外汇:'褪色',
速度:1000
});
var timeout = 0;
$(".cycle").each(function () {
var $this = $(this);
setTimeout(function () {
$this.cycle({
fx: "fade", speed: 1000
});
}, timeout);
timeout += 2000;
});
var i = 1;
var x = $(".cycle").length;
var w = setInterval( function() {
if(i==x) {
window.clearInterval(w);
}
else {
$(".cycle:nth-child('+i+')").cycle({
fx:"fade",
speed:1000
});
i++;
}
}, 3000);