Log in

View Full Version : Animation only on mouseover



DigitalBard
08-11-2007, 04:33 AM
I have a site where I display a number of animated GIFs. Having them all moving at the same time is a bit annoying.

Is there a script that will only display the first frame of a GIF and allow it to animate only when the mouse is hovering over it?

Thanks!

--Dave

---------------------------------
http://www.topekadesign.com

jscheuer1
08-11-2007, 05:07 AM
I don't think so. You could, however have a rollover. While the mouse is away, show an image captured from a single frame of the animation. Onmouseover, show the animated version.

Example:


<img src="image_frame_1.gif" onmouseover="this.src='image_ani.gif';" onmouseout="this.src='image_frame_1.gif';">

DigitalBard
08-13-2007, 08:09 PM
Thanks. I must not be getting enough sleep to have not thought of that myself. :)