I am trying to get a div to automatically cycle through images using dreamweaver. I have gotten one image to display but nothing happens after this. Can anyone see where i am going wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="Assets/styles.css" rel="stylesheet" type="text/css" />
<script>
NewImg = new Array (
"images/1.jpg",
"images/2.jpg",
"images/3.jpg",
"images/4.jpg",
"images/5.jpg"
);
/* as many or few images and the path <strong class="highlight"><vb_highlight>to</strong></vb_highlight> them */
var ImgNum = 5;
var ImgLength = NewImg.length - 1;
var delay = 3000; /* Time delay between Slides in milliseconds */
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.getElementById('slideshow').src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}
}
</script>
</head>
<body>
<div id="Shell">
<div id="header">
<img src="Images/images%3A1.jpg" name="slideshow"><br>
<a href="images<b></b>:chgImg(-1)">Previous</a> |
<a href="images<b></b>:auto()">Auto/Stop</a> |
<a href="images<b></b>:chgImg(1)">Next</a>
</div>