Web/API/DocumentOrShadowRoot/getAnimations

From Get docs

This is an experimental technologyCheck 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 AnimationsThe definition of 'document.getAnimations()' in that specification. Working Draft

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

getAnimations

Experimental'

Chrome Full support 84


Full support 84


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 84


Full support 84


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.

IE

No support No

Opera Full support 70


Full support 70


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

Full support 84

Chrome Android Full support 84


Full support 84


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 Full support 79


Full support 79


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.

Opera Android Full support 60


Full support 60


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
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