語法展示:: http://home.graffiti.net/wdfddnjkkl
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif")
var swapspeed=2
var timer
var imgpreload=new Array()
if (document.all) {
for (i=0;i<=backgroundimage.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=backgroundimage[i]
}
}
var i_backgroundimage=0
swapspeed=swapspeed*1000
function swapimages() {
if (document.all) {
window.status=i_backgroundimage
document.body.background=backgroundimage[i_backgroundimage]
i_backgroundimage++
if (i_backgroundimage>=backgroundimage.length) {i_backgroundimage=0}
timer=setTimeout("swapimages()",swapspeed)
}
}
window.onload=swapimages
-->
</script>
在 var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif") 中修改圖檔的名稱及路徑 |
在 var swapspeed=2 中修改變換的時間 |
留言列表