網上找的,效果是達到了 ,但是boss居然不滿意 ,叫我寫簡單點
var pos = 0;
setInterval(function(){
pos++;
if(pos>5) pos = 1;
document.getElementsByTagName("body")[0].style.background = "url(images/0"+pos+".jpg) round";
}, 3000);