你能用Javascript控制GIF动画吗? [英] Can you control GIF animation with Javascript?
本文介绍了你能用Javascript控制GIF动画吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用 javascript 来控制 GIF
图像的哪一帧正在显示和/或停止动画.我希望能够加载带有多个帧的 GIF
并且只显示其中一个.
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.
我知道我可以用很多单独的图像来做,但如果我可以用 GIF
做我想做的事,那么它只需要担心一个文件.
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.
推荐答案
您可以使用 CSS 精灵.
这篇关于你能用Javascript控制GIF动画吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文