一、如果用到jQuery的动画
在animate前加上 $(obj).stop(true,true)
$(obj).stop(true,true).animate()
二、通过浏览器窗口焦点事件,定时清掉定时器
window .onfocus=function(){
timer=setInterval(autoRun,1000);
}
setTimeOut(() =>{
clearInterval(timer);
}){
一、如果用到jQuery的动画
在animate前加上 $(obj).stop(true,true)
$(obj).stop(true,true).animate()
二、通过浏览器窗口焦点事件,定时清掉定时器
window .onfocus=function(){
timer=setInterval(autoRun,1000);
}
setTimeOut(() =>{
clearInterval(timer);
}){
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。