Can you control GIF animation with Javascript?
问题 Is it possible to use javascript to control which frame of a GIF image is showing and/or stop the animation. I want to be able to load a GIF with several frames and only show one of them. I know I could do it with lots of separate images, but if I can do what I want with a GIF , it will only be one file to worry about. 回答1: You can do it with a single image using CSS sprites. 回答2: You can use the libgif library. It allows you to start/stop the gif and control which frame the gif is on.