jQuery 旋转器延迟启动,彼此相隔一秒
我在首页上有三个旋转器,我希望它们彼此相隔 1 秒启动。
$(document).ready(function(){
$('#rot_top').cycle({
speed: 500,
timeout: 2000
});
$('#rot_mid').cycle({
speed: 500,
timeout: 2000
});
$('#rot_btm').cycle({
speed: 500,
timeout: 2000
});
});
初次开始后 - 他们应该按照常规暂停进行。
非常感谢您提前提供的帮助。
I have three rotators on the front page and I'd like them to start 1 second after each other.
$(document).ready(function(){
$('#rot_top').cycle({
speed: 500,
timeout: 2000
});
$('#rot_mid').cycle({
speed: 500,
timeout: 2000
});
$('#rot_btm').cycle({
speed: 500,
timeout: 2000
});
});
after the initial start - they should proceed according to their regular timeout.
Thank you so much for your help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎正在使用 jQuery Cycle 插件?如果是这样,有一个延迟选项仅延迟第一个更改:
这将立即启动第一个周期,一秒后启动第二个周期,再过一秒启动第三个周期。
It looks like you're using the jQuery Cycle plugin? If so, there's a
delay
option which delays only the first change:This will start the first cycle immediately, the second cycle a second later, and the third cycle a second after that.
setTimeout
对此非常有用,请尝试一下:setTimeout
is pretty useful for this, give this a try: