繁体   English   中英

JS:如何移除动画而不是仅仅停止它们?

[英]JS: How to remove animations rather than just stopping them?

有没有办法删除 animation? 当我运行document.getAnimations()时,我会看到我的动画列表,但我想在它们完成后删除一些。 有没有办法做到这一点? 我检查了 Web Animation API 但在文档中没有看到它。

您可以监听元素上的animationEnd事件,然后设置el.style.animation = 'none'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM