Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 SVG 中开始一个动画,当它结束时我想知道以便我可以执行另一个函数。我试过了,endEvent="endAnimate()"但什么也没发生。可以检查动画何时结束,如果是,我可以调用另一个函数吗?
endEvent="endAnimate()"
根据文档,动画元素有一个onend可以使用的事件。
onend
动画事件属性 动画事件属性是指定要为特定动画相关事件运行的脚本的事件属性。请参阅动画事件属性。动画事件属性是“onbegin”、“onend”、“onload”和“onrepeat”。
动画事件属性
动画事件属性是指定要为特定动画相关事件运行的脚本的事件属性。请参阅动画事件属性。动画事件属性是“onbegin”、“onend”、“onload”和“onrepeat”。
所以,如果你真的想把它附加到一个动画元素上,你可以像这样使用它onend="endAnimate()"
onend="endAnimate()"