检查动画何时在SVG中结束 [英] Check when an animation has ended in SVG
问题描述
我正在SVG中开始动画,当它结束时我想知道我可以执行另一个功能。我尝试过 endEvent =endAnimate()
但没有任何事情发生。可以检查动画何时结束,如果是,我可以调用另一个函数吗?
I am starting an animation in SVG and when it ends I want to know so that I can execute another function. I've tried with endEvent="endAnimate()"
but nothing happend. It's possible to check when an animation has ended and if so, can I call another function?
推荐答案
根据文档,动画元素有一个 onend
事件,你可以使用。
According to the documentation, animation elements have an onend
event that you can use.
动画事件属性
animation event attribute
动画事件属性是一个事件属性,它指定为特定动画相关事件运行的脚本。请参见动画事件属性。动画事件属性是'onbegin','onend','onload'和'onrepeat'。
An animation event attribute is an event attribute that specifies script to run for a particular animation-related event. See Animation event attributes. The animation event attributes are ‘onbegin’, ‘onend’, ‘onload’ and ‘onrepeat’.
所以,如果你真的想把它附加到一个动画元素,你可以使用它像 onend =endAnimate()
So, if you really want to attach it to an animation element you can use it like onend="endAnimate()"
这篇关于检查动画何时在SVG中结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!