javascript中创建幻灯片的问题

来源:百度知道 编辑:UC知道 时间:2024/05/19 01:46:06
1: <script language=”JavaScript”>
2: var imageList = new Array;
3: imageList[0] = new Image;
4: imageList[0].src = “image1.jpg”;
5: imageList[1] = new Image;
6: imageList[1].src = “image2.jpg”;
7: imageList[2] = new Image;
8: imageList[2].src = “image3.jpg”;
9: imageList[3] = new Image;
10: imageList[3].src = “image4.jpg”;
11: function slideShow(imageNumber) {
12: document.slideShow.src = imageList[imageNumber].src;
13: imageNumber += 1;
14: if (imageNumber < imageList.length) {
15: window.setTimeout(“slideShow(“ + imageNumber + “)”,3000);
16: }
17: }
18: </script>
19: </head>
20: <body onLoad=”slideShow(0)”>
21: <img src=http://www.webjx.com/htmldata/2006-02-06/”image1.jpg” width=100 name=”slideShow”>
============================
以上代码我测试过,不能显示,为什么呀,请

首先要学会javascript的调试方法!
用alert 进行调试。
比如,你的图片的路径对吗?

<body onLoad="slideShow(0)">
你的双引号是汉字模式的,要改成英文的!有很多。
img src=http://www.webjx.com/htmldata/2006-02-06/”image1.jpg”
这个是路径?写得有问题吧!

再好像没什么问题了!