gpt4 book ai didi

jQuery循环插件交错/增量

转载 作者:行者123 更新时间:2023-12-01 00:14:59 29 4
gpt4 key购买 nike

我目前正在使用 jquery 循环插件。我有 3 个不同的幻灯片,它们彼此相邻并同时循环播放。我想做的是先关闭第一张幻灯片,然后是第二张幻灯片,然后是第三张幻灯片。无论如何,我可以通过增量或超时来做到这一点吗?

<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
});

最佳答案

var timeout = 0;

$(".cycle").each(function () {
var $this = $(this);
setTimeout(function () {
$this.cycle({
fx: "fade", speed: 1000
});
}, timeout);

timeout += 2000;
});

关于jQuery循环插件交错/增量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14443316/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com