Help with slideshow.need some more funtions.PLEASE HELP!
Here is my code, it works great, but i want to add more functions.
I want to add a Slide counter,like this “Slide: 10/15”.
[code]<SCRIPT LANGUAGE=”JavaScript”>
<!– Original: Mike Canonigo ([email protected]) –>
<!– Web Site: http://www.munkeehead.com –>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! http://javascript.internet.com –>
<!– Begin
NewImg = new Array (
“pic1.jpg”,
“pic2.jpg”,
“pic3.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[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval(“chgImg(1)”, delay);
}
}
// End –>
</script>
</HEAD>
<!– STEP TWO: Copy this code into the BODY of your HTML document –>
<BODY>
<img src=”http://i4.photobucket.com/albums/y112/fob1k/P1020267.jpg” name=”slideshow” width=700 height=550>
<table>
<tr>
<td align=”right”><input type=”button” value=”Previous” onClick=”javascript:chgImg(-1)” /></td>
<td align=”center”><input type=”button” value=”Auto/Stop” onClick=”javascript:auto()” /><td>
<td align=”left”><input type=”button” value=”Next” onClick=”javascript:chgImg(1)” /></td>
</tr>
</table>