js如何使用多个定时器页面跳转
1个回答
展开全部
var timers = [];
window.onload = function(){
for(var i = 0; i < 9; i++) {
var timer = setInterval(function(){
window.location.href = "";
});
timers.push(timer);
}
}
var destroy = function(){
for (var i = 0; i < timers.length; i++) {
if(!!timers[i]) {
clearInterval(timers[i]);
timers[i] = null;
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询