var image=document.getElementById("img的ID");(image需要是全局变量)var i=0; (全局的)var time; (全局的)var img=Array(5); (存链接)function f(){time=setInterval("fuc()",1000);}functin fuc(){ if(i==5) i=0; image.src=img[i]; i++;}