Image Rotation Script
The images are set to refresh every five seconds. You can place your images in a directory, naming them image0.gif, image1.gif, etc. The script will sequentially rotate through the images starting with image0. You can use .jpg or .png images if preferred by changing the .gif in gImages[i] = "images/image" + i + ".gif
into .jpg or .png.
Define the number of images and set the timer for the rotation in this section of the script:
gSlideshowInterval = 5;
// how often the images are refreshed (time given in seconds)
gNumberOfImages = 5;
// the total number of images used
Define the directory where the images are located, the generic image name and extension in this section of the script:
gImages = new Array(gNumberOfImages);
for (i=0; i<gNumberOfImages;i++){
gImages[i] = "images/image" + i + ".gif"; }
// change to .png or .jpg if applicable
Make sure that all the images are named sequentially (f.e. image0.gif, image1.gif, etc.), else the array will get corrupted, and start numbering with 0, not with 1. The name="slide"
expression has to be inside the IMG tag to invoke the script.