我使用的是Chrome版本67.0.3396.99(64位)。
Mozilla文档
Web Animations API
描述一种方法
getAnimations()
像这样:
document.getAnimations().forEach(
function (animation) {
animation.playbackRate *= .5;
}
)
但Chrome似乎不支持它。我试过了
var animations = document.getAnimations ? document.getAnimations() : document.timeline.getAnimations();
照此
blogpost
Uncaught TypeError: Cannot read property 'getAnimations' of undefined
有没有一种方法可以通过web动画api检索应用于HTML元素的动画数组?