Results 1 to 3 of 3

Thread: Animation only on mouseover

  1. #1
    Join Date
    Aug 2007
    Location
    Kansas, USA
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Animation only on mouseover

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <img src="image_frame_1.gif" onmouseover="this.src='image_ani.gif';" onmouseout="this.src='image_frame_1.gif';">
    Last edited by jscheuer1; 08-11-2007 at 05:22 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2007
    Location
    Kansas, USA
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks. I must not be getting enough sleep to have not thought of that myself.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •