1
這是我的代碼,但我想要一個無限循環。請幫助,溫柔。解釋代碼的完整位置,因爲我不知道html。 如果你有一個更好的代碼供我使用,我將不勝感激,但我發現這在網絡上,它的工作原理除了無限循環。 這是一個2圖像幻燈片。無限循環幻燈片
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="/v/vspfiles/assets/images/home1.jpg"
var image2=new Image()
image2.src="/v/vspfiles/assets/images/home2.jpg"
//-->
</script>
<div style="text-align: left;"><br></div><div style="text-align: center;"><img src="http://xvrlm.lhcjd.servertrust.com/v/vspfiles/assets/images/home2.jpg" name="slide" width="610" height="78">
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
什麼是document.images.slide? – mowwwalker
我相信你的代碼也運行了無限次... –