Jquery Cycle Plugin - webkit 浏览器在刷新时启动暂停循环
这是我的代码
$('#gallery-photos').cycle({
fx: 'fade',
speed: 500,
timeout: 3000,
pager: '#gallery-navigation',
requeueOnImageNotLoaded: true,
after: onAfter
}).cycle('pause');
正如你所看到的,循环将在初始化后停止,正如 Malsup 本身在互联网上的一些帖子中显示的那样......但是当我使用 Chrome 或 Safari 刷新页面时,循环开始,忽略暂停命令。
我在同一页面中有另一张幻灯片默认自动启动,但它与前一张幻灯片不相关
$(document).ready(function() {
$('#header-gallery-conteiner').cycle({
fx:'scrollUp',
speed: 888,
timeout: 4000,
requeueOnImageNotLoaded: true
});
});
如何才能使其即使在使用 webkit 浏览器刷新后也能正确暂停?
This is my code
$('#gallery-photos').cycle({
fx: 'fade',
speed: 500,
timeout: 3000,
pager: '#gallery-navigation',
requeueOnImageNotLoaded: true,
after: onAfter
}).cycle('pause');
As you can see the cycle will stop after init, as Malsup itself showed in some posts around the internet... but when i refresh page with Chrome or Safari, the cycle starts, ignoring the pause command.
I have another slideshow in the same page that autostarts as default, but it is not involved with the previous one
$(document).ready(function() {
$('#header-gallery-conteiner').cycle({
fx:'scrollUp',
speed: 888,
timeout: 4000,
requeueOnImageNotLoaded: true
});
});
How can i make it able to pause correctly even after refresh with webkit browsers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的第一个代码块移动到 $(document).ready() 事件中,如下所示:
您应该只将一个函数分配给
$(document).ready()
,所以如果您也有它您页面上的其他部分将其删除,并将代码添加到上面的函数中move you first block of code inside the $(document).ready() event like this:
You should only have one function assigned to
$(document).ready()
, so if you have it also somewere else on your page get rid of it, and add the code to to the function above