I have a "Random Click Image" script that works with regular images but I want to use
"Play Once .gif Animations".
What happens is it will play the first animation when the page loads, But when you Click for a random image they show the finished animations only? They do NOT animate they only show the end of the animation.
Can anyone help me get this script to play each animation through?
Here is the script:
-------------------------------
<HEAD>
var rand1 = 0;
var useRand = 0;
images = new Array;
images[1] = new Image();
images[1].src = "image1.gif";
images[2] = new Image();
images[2].src = "image2.gif";
images[3] = new Image();
images[3].src = "image3.gif";
images[4] = new Image();
images[4].src = "image4.gif";
images[5] = new Image();
images[5].src = "image5.gif";
function swapPic() {
var imgnum = images.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
document.randimg.src = images[useRand].src;
}
</script>
</HEAD>
-------------------------------------
<BODY OnLoad="swapPic()">
-------------------------------------
<center>
<a onClick="swapPic();"><img name="randimg" src="image1.gif"></a><br>
<font face="Verdana" size="-2">click image to change</font>
</center>
--------------------------------------
Any help would be appreciated.
Thanks
Lon