jquery循环与悬停效果
大家好,我需要一些帮助,对jquery仍然很陌生,
我正在使用循环插件,到目前为止我有以下内容,我试图找到添加悬停的方法,
这样当用户将鼠标悬停在菜单中的链接上时,它就会循环通过它暂停循环并切换到悬停即用户控制,
但在鼠标移出一段时间后它会恢复
var n=0
var dn=1
$(document).ready(function() {
$('.slideshow')
.cycle({
fx: 'fade',
speed: 500,
timeout: 3000,
before: function(curr, next, opts) {
n=n+1;
if (n>5) {n=1;dn=5}
$('#item'+dn).removeClass("active");
$('#item'+(n)).addClass("active");
dn=n;
}
});
$(".slideshow").cycle('resume');
$(".slideshow").mouseover(function(){
$(this).cycle('pause');
}).mouseout(function(){
$(this).cycle('resume');
});
});
对此的任何帮助将非常感谢
hi all i need some help still very new to jquery
i am using the cycle add-on i have the following so far i am trying to find away of adding onto it a hover
so when a user hovers over the links in menu it is cycling through it pauses the cycle and switch to hover ie user control
but after awhile of mouse-out it resumes
var n=0
var dn=1
$(document).ready(function() {
$('.slideshow')
.cycle({
fx: 'fade',
speed: 500,
timeout: 3000,
before: function(curr, next, opts) {
n=n+1;
if (n>5) {n=1;dn=5}
$('#item'+dn).removeClass("active");
$('#item'+(n)).addClass("active");
dn=n;
}
});
$(".slideshow").cycle('resume');
$(".slideshow").mouseover(function(){
$(this).cycle('pause');
}).mouseout(function(){
$(this).cycle('resume');
});
});
any help on this would be great thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当前设置为在未将鼠标悬停在幻灯片上 500 毫秒后恢复。
Current set to resume after 500ms of not hovering over the slideshow.