我使用的是 Chrome 版本 67.0.3396.99(64 位)。
Web Animations API上的 Mozilla 文档描述了getAnimations()
如下方法:
document.getAnimations().forEach(
function (animation) {
animation.playbackRate *= .5;
}
)
但是 Chrome 似乎不支持它。我试过了……</p>
var animations = document.getAnimations ? document.getAnimations() : document.timeline.getAnimations();
…也根据 Daniel C. Wilson 的这篇博文,但它在 Chrome 67 上中断并出现以下错误:
Uncaught TypeError: Cannot read property 'getAnimations' of undefined
有没有办法使用 web 动画 api 检索应用于 HTML 元素的动画数组?