js 实现谷歌浏览器中隐藏标签后setInterval事件暂停

Interval_control= setInterval(function(){newsSlide_ChangeImg(-1,'left',start_time);},3000);//设置自动切换函数

window.addEventListener('focus', function() {

                     Interval_control= setInterval(function(){newsSlide_ChangeImg(-1,'left',start_time);},3000);//设置自动切换函数

                  },false);

window.addEventListener('blur', function() {

                     window.clearInterval(Interval_control);

              },false);

上一篇:MobX入门


下一篇:Apache + Tomcat 配置多个应用