Hi all,
What I am trying to create an animation without creating animated gif's. I was thinking on having a mouseover command call a function that changes the image.src in a given amount of time. How can this be done?
This is what I have now... i'm not sure why it doesn't really work. Can someone point me on where to look, or help me out with my code.
Thanks ahead of time
What I am trying to create an animation without creating animated gif's. I was thinking on having a mouseover command call a function that changes the image.src in a given amount of time. How can this be done?
This is what I have now... i'm not sure why it doesn't really work. Can someone point me on where to look, or help me out with my code.
Thanks ahead of time
Code:
<script language="JavaScript">
<!--
image = new Array();
var counter = 0;
do {
image[counter] = new Image();
image[counter].src = "myImage"+counter+".jpg
} while (counter<12);
function animate()
{
counter2=0;
do {
rollover.src = image[counter2].src;
repaint();
// Some pause set Interval
if (counter2 == 12) counter2 = 0 ;
} while (true);
}
// ->
</SCRIPT>
<a href=blah.html onMouseOver=animate() onMouseOut = rollover.src = image[0].src>Animate</a>
<img name=rollover src=image[0].src width=504 height=285 border=0>