无标题文档
var i=document.getElementById("i") var arr=["../../img/1.jpg","../../img/2.jpg","../../img/3.jpg"] var idx=0 function changeImage(){ i.src=arr[++idx%3] } var task=window.setInterval('changeImage()',2000) function stopChange(){ window.clearInterval(task) } function startChange(){ task=window.setInterval('changeImage()',2000) }
var i=document.getElementById("i") var arr=["../../img/1.jpg","../../img/2.jpg","../../img/3.jpg"] var idx=0 function changeImage(){ i.src=arr[++idx%3] } var task=window.setInterval('changeImage()',2000) function stopChange(){ window.clearInterval(task) } function startChange(){ task=window.setInterval('changeImage()',2000) }