1、window.setTimeout(function(){},3000)
延迟3秒执行
2、window.setInterval(function(){},3000)
也叫重复器,,每3秒重复相同的事件
关闭定时器:
var timer = window.setTimeout(function(){
window.clearTimeout("timer");
},3000);
var timer = window.setInterval(function(){
window.clearInterval("timer");