首页 > 其他 > 详细

bom延迟方法.间隔执行

时间:2017-04-22 10:58:42      阅读:156      评论:0      收藏:0      [点我收藏+]

<script>
// 延时方法
// window.setTimeout(sto,3000);
// function sto(){
// alert(‘123‘);
// window.setTimeout(sto,3000);
// }
// 间隔执行
var c1 = 0;
var c2 = 0;
var arr = Array();
arr.push(window.setInterval("sit1()", 500));
arr.push(window.setInterval("sit2()", 500));

function sit1() {
document.getElementById(‘s1‘).innerText = ++c1;
}

function sit2() {
document.getElementById(‘s2‘).innerText = ++c2;
}

function stop() {
for(var i in arr) {
window.clearInterval(arr[i]);
}
}
// window.clearInterval(1);
// alert(x);
// alert(y);
</script>

bom延迟方法.间隔执行

原文:http://www.cnblogs.com/zhushijun/p/6747087.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!