Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Slide Show - need help please

Status
Not open for further replies.

snufse1

Programmer
Nov 14, 2008
66
US
Below is code I plan to incorporate in my asp application. I cannot get the slid show to work. It shows the 1st image but no image rotation. Can anyone tell me what I am doing wrong? Thank you

<head>

<SCRIPT LANGUAGE="JavaScript">

NewImg = new Array (
"C:/Documents and Settings/vgwprja/My Documents/Visual Studio 2005/WebSites/TestSlideShow/Images/01.jpg",
"C:/Documents and Settings/vgwprja/My Documents/Visual Studio 2005/WebSites/TestSlideShow/Images/02.jpg",
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 3000;

var lock = false;
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
;
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}
}

</script>

</head>

<body>

<img src="C:/Documents and Settings/vgwprja/My Documents/Visual Studio 2005/WebSites/TestSlideShow/Images/01.jpg" onload= "auto()"

alt="No image" name="slideshow"/>

</body>

</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top