2

I'm on Chrome Version 67.0.3396.99 (64-bit).

Mozilla documentation on Web Animations API describes a method getAnimations() like so:

document.getAnimations().forEach(
  function (animation) {
    animation.playbackRate *= .5;
  }
)

But it doesn't appear to be supported on Chrome. I tried…</p>

var animations = document.getAnimations ? document.getAnimations() : document.timeline.getAnimations();

…as per this blogpost by Daniel C. Wilson as well, but it breaks on Chrome 67 with the following error:

Uncaught TypeError: Cannot read property 'getAnimations' of undefined

Is there a way to retrieve the array of animations applied on an HTML element with web animations api?

4

1 に答える 1