我找不到爲什麼我的圖片幻燈片不能在網頁上工作,有人可以告訴我爲什麼嗎?圖片幻燈片javascript
我有以下
<head>
<script type ="text/javaScript">
var image1=new Image()
image1.src="download.jpg"
var image2=new Image()
image2.src="beauty.jpg"
</script>
</head>
<body>
<img src="download.jpg" name="firstImage" height = 100 width=300></img>
</body>
<script type="text/javascript">
//variable that would increment through the images
var step = 1
function slideit() {
//if browser does not support the image object exit
if(!document.images)
return document.images.firstImage.src=eval("image"+step+".src")
if(step<2)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
</script>
</html>
的代碼,我試圖把整個JavaScript的一個標籤,但它並沒有真正影響它,有人能告訴我,我可能會丟失?先謝謝你。
我認爲它什麼都不做'如果(步驟<2)步驟++其他步驟= 1' –
@ user3766803這裏有幾個問題,但不要擔心...我們都在這裏學習:) –