jQuery 幻灯片:加载暂停,从链接问题开始
我见过与我类似的问题,但不完全是。 我的页面上运行着多个循环幻灯片,因此我不希望它们同时开始。 我想暂停加载它们,然后在单击一个简单的链接时启动。这是我的想法:
$('#s2').cycle({
fx: 'scrollLeft',
speed: 2000,
pause: 1,
pager: '#speakerTwoNav',
pagerAnchorBuilder: function(idx, el) {
return '<a href="#"></a>';
}
}).cycle('pause');
$('#speakerInfoChipKiddLink').click(function(){
$('#s2').cycle('resume');
});
这是其中一张幻灯片的示例。 #s2
是它的名称,#speakerInfoChipKidd
是我想要开始幻灯片放映的链接的 ID。
我没有收到此代码的错误,它只是没有立即暂停它。
I've seen similar problems to mine, but not exactly.
My page has multiple cycle slideshows running on it, so I don't want them to all start at once.
I'd like to load them paused, then start when clicking a simple link. Here's what I've come up with:
$('#s2').cycle({
fx: 'scrollLeft',
speed: 2000,
pause: 1,
pager: '#speakerTwoNav',
pagerAnchorBuilder: function(idx, el) {
return '<a href="#"></a>';
}
}).cycle('pause');
$('#speakerInfoChipKiddLink').click(function(){
$('#s2').cycle('resume');
});
This is an example of one of the slideshows. #s2
is the name of it, and #speakerInfoChipKidd
is the id of the link I want to start the slideshow.
I'm not getting errors with this code, it's just not pausing it right away.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将初始化和暂停分开:
Separate out the initialise and the pause :