在javascript上自动幻灯片放映

时间:2013-06-19 10:28:24

标签: javascript slideshow autoplay

在此脚本上需要有关自动幻灯片放映的帮助:

NewImg = new Array (
"images/Pic03.png",
"images/Pic01.jpg",
"images/Pic02.jpg"
);

var random_display = 0;
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
var totalImages = NewImage.l
//Time delay between Slides in milliseconds
var delay = 1500;
var lock = true;
var run;

function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}

document.slideshow.src = NewImg[ImgNum];
   }
}

我的下一个和后退按钮没问题,但幻灯片显示没有自动播放。

0 个答案:

没有答案