Document.getAnimations()

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The getAnimations() method of the Document interface returns an array of all Animation objects currently in effect whose target elements are descendants of the document. This array includes CSS Animations, CSS Transitions, and Web Animations.

Syntax

var allAnimations = Document.getAnimations();

Parameters

None.

Return value

An Array of Animation objects, each representing one animation currently associated with elements which are descendants of the Document on which it's called.

Examples

The following code snippet will slow down all animations on a page by halving their Animation.playbackRate.

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

Specifications

Specification Status Comment
Web Animations
The definition of 'document.getAnimations()' in that specification.
Working Draft

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
getAnimations
Experimental
Chrome Full support 83
Disabled
Full support 83
Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
No support 67 — 83
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Chromium bug 828585.
Disabled From version 67 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
No support 61 — 67
Notes Disabled
Notes Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot, see Chromium bugs 828424 and 828585.
Disabled From version 61 until version 67 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
Edge Full support 83
Disabled
Full support 83
Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference.
No support 79 — 83
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Chromium bug 828585.
Disabled From version 79 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Firefox Full support 75
Full support 75
No support 72 — 75
Disabled
Disabled From version 72 until version 75 (exclusive): this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
No support 63 — 72
Notes Disabled
Notes Not supported on ShadowRoot.
Disabled From version 63 until version 72 (exclusive): this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
No support 47 — 63
Notes Disabled
Notes Not supported on ShadowRoot.
Disabled From version 47 until version 63 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
No support 46 — 47
Notes Disabled
Notes Does not return any animations on pseudo-elements and is not supported on ShadowRoot.
Disabled From version 46 until version 47 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 69
Disabled
Full support 69
Disabled
Disabled From version 69: this feature is behind the #enable-experimental-web-platform-features preference.
No support 54 — 69
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Chromium bug 828585.
Disabled From version 54 until version 69 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
No support 48 — 54
Notes Disabled
Notes Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot, see Chromium bugs 828424 and 828585.
Disabled From version 48 until version 54 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Safari Full support 14
Full support 14
Partial support 13.1
Notes
Notes Implements an older version of the specification and not supported on ShadowRoot, see Webkit bugs 179536 and 202192.
Partial support Partial
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Webkit bugs 179536 and 202192.
Disabled This feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.
WebView Android No support No
Notes
No support No
Notes
Notes Currently Chrome Canary only
Chrome Android Full support 83
Disabled
Full support 83
Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
No support 67 — 83
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Chromium bug 828585.
Disabled From version 67 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
No support 61 — 67
Notes Disabled
Notes Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot, see Chromium bugs 828424 and 828585.
Disabled From version 61 until version 67 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
Firefox Android Partial support 63
Notes Disabled
Partial support 63
Notes Disabled
Notes Not supported on ShadowRoot.
Disabled From version 63: this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
No support 47 — 63
Notes Disabled
Notes Not supported on ShadowRoot.
Disabled From version 47 until version 63 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
No support 46 — 47
Notes Disabled
Notes Does not return any animations on pseudo-elements and is not supported on ShadowRoot.
Disabled From version 46 until version 47 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
Opera Android Partial support 48
Notes Disabled
Partial support 48
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Chromium bug 828585.
Disabled From version 48: this feature is behind the #enable-experimental-web-platform-features preference.
No support 45 — 48
Notes Disabled
Notes Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot, see Chromium bugs 828424 and 828585.
Disabled From version 45 until version 48 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Safari iOS Full support 14
Full support 14
Partial support 13.4
Notes
Notes Implements an older version of the specification and not supported on ShadowRoot, see Webkit bugs 179536 and 202192.
Partial support Partial
Notes Disabled
Notes Implements an older version of the specification and not supported on ShadowRoot, see Webkit bugs 179536 and 202192.
Disabled This feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No support No

Legend

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also