//除了@zhiqixie 说的, 还应该加 上 //鼠标移动到内容上停止自动切换 $('notice-con').onmouseover=function(){ clearInterval(timer); } $('notice-con').onmouseout=function(){ timer=setInterval(autoPlay,2000); }
汪星人陈达
2014-09-05
3 回答
//tab栏
for (var i = 0; i < lis.length; i++) {
lis[i].id = i;
lis[i].onmouseover = function() {
clearInterval(timer);
changeOption(this.id);
}
lis[i].onmouseout = function() {
timer = setInterval(autoPlay, 2000);
}
}
//内容
for (var j = 0; j < divs.length; j++) {
divs[j].onmouseover = function() {
clearInterval(timer);
}
divs[j].onmouseout = function() {
timer = setInterval(autoPlay,2000);
}
}
//这样写不能简化语句,
举报
0/150
提交
取消