我正在 SVG 中启动一个动画,当它结束时我想知道,以便我可以执行另一个函数。我尝试过 endEvent="endAnimate()"
但没有任何反应。可以检查动画何时结束,如果是,我可以调用另一个函数吗?
最佳答案
根据文档,动画元素有 onend
您可以使用的事件。
animation event attribute
block 引用>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()"
一样使用它
关于javascript - 检查 SVG 中的动画何时结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16482923/