//图像轮替显示 window.onload=setInterval(change,2000); var n=1; function changePic(m){ return n=m; } function change(){ var myImg=document.getElementById("rotate"); var text=document.getElementById(""+n); for(i=1;i<=5;i++){ if(i==n) text.style.color="red"; else{ var tt=document.getElementById(""+i); tt.style.color="blue"; } } myImg.src="images/0"+n+".jpg"; if(n<5)n++; else n=1; }