Help - Search - Members - Calendar
Full Version: Pausing a GIF animation on mouse-click or hover
HTMLHelp Forums > Web Authoring > Graphics, Flash and Multimedia
dsmith916
I'm trying to stop a GIF animation when someone hovers over it but the closest thing I've found is how to start the animation on mouse-over here: http://stackoverflow.com/questions/7473117...-a-gif-on-hover

My problem with this is it uses an alternate file for the paused frame which is fine for certain purposes but not what I want to do.

I want the user to be able to pause the animation on any frame they want simply by placing their mouse over the GIF while it's playing.
Christian J
My browser doesn't allow GIF animations in the first place...
dsmith916
QUOTE(Christian J @ Dec 13 2013, 02:54 PM) *

My browser doesn't allow GIF animations in the first place...


What browser? Did you do that yourself?
Christian J
In Opera (the real Opera, before the current Blink-based disaster) it's a setting in Preferences. I'd go nuts without it. tongue.gif

IE has a setting tucked away in the Tools > Preferences > Advanced tab.

Firefox hides its setting in about:config for some reason: http://kb.mozillazine.org/Firefox_:_Tips_:_Animated_Images

Chrome (being useless as always) may require extensions to stop it, but I haven't tried.

Christian J
QUOTE(dsmith916 @ Dec 13 2013, 08:38 PM) *

I want the user to be able to pause the animation on any frame they want simply by placing their mouse over the GIF while it's playing.

No idea if you can do that with animated GIFs. As a workaround (depending on the nature of the animation) you might use a fast slideshow with static images.
dsmith916
QUOTE(dsmith916 @ Dec 13 2013, 08:38 PM) *

I want the user to be able to pause the animation on any frame they want simply by placing their mouse over the GIF while it's playing.


I can't believe no one has done this before. I can think of so many good reasons you'd want to pause a GIF and continue it. I can't imagine there isn't some relatively easy way to do it. I've found a thousand how-to's on making them play on mouse-over but nothing else. They always 'pause' on the first frame when you take your mouse off too which is good for some purposes but why wouldn't someone want to pause it on the current frame and then continue to get a closer look at a frame of the GIF? It would be great for analyzing motion for example skateboarding tricks or car crashes or scientific time-lapse applications. I find it really hard to believe there's no way to script the pausing and playing of a GIF without restarting it from the beginning.
pandy
They have. Top of Google: http://freezeframe.chrisantonellis.com/ .
dsmith916
QUOTE(pandy @ Dec 13 2013, 05:34 PM) *

They have. Top of Google: http://freezeframe.chrisantonellis.com/ .


Read more carefully - that is the exact opposite of what I want to do. I want to have the gif play automatically and STOP on mouse over. Also that link is just like every other tutorial: it stops on the first frame not on the current frame.

There are thousands of tutorials on how to make a GIF start on mouse-hover and when the mouse isn't over it go back to the first frame of the GIF (or sometimes a user defined image) but that is not what I want. I want the exact opposite.

I am trying to make the GIF stop on mouse-hover and stop on the current frame of the GIF, and continue playing from that frame when the mouse is no longer hovering over the image.
pandy
I'm pointing out that it's possible to stop the animation. As I understand it the script does that, but not when you want. Do some research and don't expect ready cookie cutter solutions all the time.
dsmith916
QUOTE(pandy @ Dec 15 2013, 09:34 PM) *

I'm pointing out that it's possible to stop the animation. As I understand it the script does that, but not when you want. Do some research and don't expect ready cookie cutter solutions all the time.


I don't. I just find it very hard to believe that this is something no one has done before or knows how to do, which is how it seems. Maybe it's impossible? I find that very hard to believe too, that you can't just pause and play GIF animation.
dsmith916
I just found something promising (very close to what I want to do anyway)

http://slbkbs.org/jsgif/

You need to add a book mark for some reason but the javascript gives you total control over gifs and lets you pause and play from the current frame of any gif.

Now I just need to modify this script so it just pauses/plays on each click, and remove the buttons from the interface.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.