Stopping GIF Animation Programmatically

Karussell picture Karussell · Sep 10, 2010 · Viewed 64.2k times · Source

I am developing a Twitter application which references to the images directly from Twitter. How can I prevent animated gifs from being played?

Using window.stop() at the end of the page does not work for me in Firefox.

Is there a better JavaScript hack? Preferable this should work for all browsers

Answer

Krasimir picture Krasimir · Jun 19, 2014

Inspired by the answer of @Karussell I wrote Gifffer. Check it out here https://github.com/krasimir/gifffer

It automatically adds stop/play control on top of your Gif.