<script> var arr=new Array(); arr[0]="url(images/city.jpg)"; arr[1]="url(images/desert.jpg)"; arr[2]="url(images/flower.jpg)"; var i=0; function changeimage() { if(i==3) { i=0; } var div=document.getElementById("apdiv1"); div.style.backgroundImage=arr[i]; i++; window.setTimeout("changeimage()",1000); } changeimage(); </script>
时间: 2024-12-14 22:02:41