I'm trying to look for an example of code that allows the user to animate a gif on mouseover and pause when mouse out. I've seen many tutorials talking about this but I want a different effect.
I noticed that most gifs "reset" when on mouse out. That is, either the gif is covered with a generic image or the animation reverts back to the start. What I would like to achieve is a more seamless "pause" that allows you to start where you left off without using a placeholder image. Similar to the example on this page:
http://www.valhead.com/2013/03/11/animation-play-state/
Notice how when you put the mouse over the image, the animation just pauses without replacing anything, and resumes otherwise.
I don't know if it's possible with a gif because this example is using basic css shapes, but there has to be some way to pause the gif on mouse out and resume on mouse over without covering the image on a looping animation? If not is there a way to use a movie file that pauses on mouse over and plays where it left off when you put the mouse over it?
Thanks!
EDIT: Thanks to @brbcoding and his genius, this issue was solved! Details on the solution can be found either in the posts below or on his blog post: http://codyhenshaw.com/blog/2013/12/17/faux-animated-gifs-with-css3-keyframes/
.gif
s, as I see that same behavior on sites which use that effect (but cannot remember which one(s) offhand). The linked demo is not a.gif
at all, and should work the same in all modern browsers. – Prittleprattle.gif
s. I was pointing out that I have seen sites which display animated gifs like OP is describing, where they are static images, and on hover they are swapped out for a coorespondinggif
. – Prittleprattle