for (var i=0 i<items.length i++) {
var item = items[i]
setTimeout(function(){
item.style.backgroundColor = 'red'
},5)
}
<span id=txt></span><script>
var i=0
setTimeout(function t(){
document.getElementById("txt").innerHTML+=(i+++5)%6+" "
if(i<6)setTimeout(t,1000)
},1000)
</script>
function FangFa(){ ...... } function Start(){ setInterval(FangFa, 3000)//每3秒调用一次方法 } setTimeout(Start, 5000)//延迟5秒开始周期回调