hello,
you can use array to store all image's URLs , and then you can loop over the array items to preload these images ( you can ignore the image preloader if you want to)
create a simple function to change the image source
jscript
<html>
<head>
<script language="Javascript">
<!--Hide from the old browser
currentImageIndex=0
imgArr=new Array("Arachnid.jpg","Bison.jpg","Coyote.jpg","Deer.jpg", "Elk.jpg","Feline.jpg")
if (document.images)
{
for (i=0;i<imgArr.length;i++){
img=new Image()
img.src=imgArr[i];
}
}
function roll(bf){
currentImageIndex+=bf;
if (currentImageIndex<0)currentImageIndex=imgArr.length-1
if(currentImageIndex>imgArr.length-1)currentImageIndex=0
document.getElementById("rollover").src=imgArr[currentImageIndex];
}
//-->
</script>
</head>
<title> Images </title>
<body>
<img src="Arachnid.jpg" id="rollover" width="250" hieght="250"><br><br>
<input type="BUTTON" value="Foward" onClick="roll(1)"> <!--Button to call the pictures-->
<input type="BUTTON" value="Back" onClick="roll(-1)"> <!--Button to call the pictures in reverse-->
</body>
</head>