1
Im在單個網頁上有多個javascript幻燈片的isues。我可以讓一個幻燈片放映設置正常工作,但是當我放置其他幻燈片時,我認爲這些腳本正在抵消彼此的影響。請幫忙。在單個頁面上存在多個javascript幻燈片的問題
這裏是在報頭中的JS:
</script>
<script type="text/javascript">
var image1 = new Image()
image1.src = "images/linen/ldp-1.jpg"
var image2 = new Image()
image2.src = "images/linen/ldp-2.jpg"
var image2 = new Image()
image2.src = "images/linen/ldp-3.jpg"
var image2 = new Image()
image2.src = "images/linen/ldp-4.jpg"
</script>
<script type="text/javascript">
var image5 = new Image()
image5.src = "images/linen/ldp-5.jpg"
var image6 = new Image()
image6.src = "images/linen/ldp-6.jpg"
var image7 = new Image()
image7.src = "images/linen/ldp-7.jpg"
var image8 = new Image()
image8.src = "images/linen/ldp-8.jpg"
</script>
這裏是體:
<div align="center">
<img src="images/linen/ldp-1.jpg" width="300" height="300" name="slide" />
<script type="text/javascript">
var step=1;
function slideit()
{
document.images.slide.src = eval("image"+step+".src");
if(step<2)
step++;
else
step=1;
setTimeout("slideit()",3000);
}
slideit();
</script>
<img src="images/linen/ldp-5.jpg" width="300" height="300" name="slide" />
<script type="text/javascript">
var step=1;
function slideit()
{
document.images.slide.src = eval("image"+step+".src");
if(step<2)
step++;
else
step=1;
setTimeout("slideit()",3000);
}
slideit();
</script>
對不起,Java的新手......不知道該怎麼做......我把它從谷歌中解放出來,希望它能起作用,如果我只是複製它 –