汪星人陈达
2014-09-05 13:13
//除了@zhiqixie 说的, 还应该加 上
//鼠标移动到内容上停止自动切换
$('notice-con').onmouseover=function(){
clearInterval(timer);
}
$('notice-con').onmouseout=function(){
timer=setInterval(autoPlay,2000);
}
//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);
}
}
//这样写不能简化语句,
aDiv[i].onmouseover = function ()
{
clearInterval(timer);
};
我直接就这么关闭了Tab选项卡切换效果
65459 学习 · 581 问题
相似问题