标签:time cti 时钟 timer over opp use top out
timer = setInterval(mar,30);
//鼠标移上去清除时钟
box.onmouseover = function(event){
clearInterval(timer);
event.stopPropagation();
//这里是阻止冒泡,不加要冒泡到body上面,鼠标在body上面就会clearInterval(timer);
box.onmouseout = function(event){
timer = setInterval(mar, 30);
event.stopPropagation();
}
};
//用jq方式写
/*$(box).on(‘mouseover‘,function(){
clearInterval(timer);
})*/
// $(box).mouseover(function(event){
// clearInterval(timer);
// event.stopPropagation();
// $(box).mouseout(function(e){
// timer = setInterval(mar,30);
// e.stopPropagation();
// })
// });
标签:time cti 时钟 timer over opp use top out
原文地址:http://www.cnblogs.com/fdxxiaobai/p/6856219.html