Thank you descalzo. I did notice another error with my script as well.
arrays indices start at 0 so I had to change imgArrLen from images.length; to (images.length-1) otherwise it would repeat the last object or show up blank
If anyone else wants to use this feel free.
Code:
/***************************
Author: Nick Williams
Must stay intact for use
***************************/
// Variables (DO NOT MODIFY ANYTHING ON THIS PAGE)
var
i = -1,
images = new Array(),
delay,
img,
imgArrLen;
// Slideshow function
function slideShow() {
// Array length
imgArrLen = (images.length-1),
// Get image id
img = document.getElementById("image");
if( i >= imgArrLen)
i=0;
else
i++;
// Change the image source
img.src = images[i];
// Start the function again
setTimeout("slideShow()",delay);
}
HTML (<head>) :
HTML Code:
<script type="text/javascript" language="JavaScript" src="slideShow.js"></script>
<script type="text/javascript" language="JavaScript">
<!--
// Only change these variables
images = ['i1.gif','i2.gif','i3.gif','i4.gif','i5.gif']; // Array of images (Add or subtract as necessary (put each within ''s))
delay = 4; // Delay between slides in seconds (4 or more is reccommended);
// Do not edit below this line
// ---------------------
delay = delay*1000;
-->
</script>
HTML (<body>) :
HTML Code:
<body onload="slideShow()">
<img src="i1.gif" id="image" width="200" height="200" onclick="window.open(this.src)" />
By default clicking on the image will open the full image in a new window/tab