Determine GIF Animation Status?

為{幸葍}努か 提交于 2019-12-01 23:56:56

问题


Is there any way to detect via javascript whether a GIF image's animation is completed or not?


回答1:


No, it is not. Javascript cannot manipulate GIF directly. But maybe jsgif can help you




回答2:


By now it's possible. There are packages available to extract information from byte buffer. Like gif-info.

Combining that with HTMLImage.onload it's possible to start timeout exactly with delay when animation should already ended.

Or having duration value we can set up CSS animation on target image that would work in more stable way.

But although it's technically possible it still looks as overkill.



来源:https://stackoverflow.com/questions/11063800/determine-gif-animation-status

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!