Document: getAnimations() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.
getAnimations()
メソッドは Document
インターフェイスのメソッドで、この文書の配下にあるターゲット要素にあるすべての Animation
オブジェクトの配列を返します。この配列には CSS アニメーション, CSS トランジション, ウェブアニメーション が含まれます。
構文
js
getAnimations()
引数
なし。
返値
例
次のコードスニペットは、ページ上のすべてのアニメーションの Animation.playbackRate
を半分にすることで速度をゆっくりにします。
js
document.getAnimations().forEach((animation) => {
animation.playbackRate *= 0.5;
});
仕様書
Specification |
---|
Web Animations # dom-documentorshadowroot-getanimations |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getAnimations |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
- ウェブアニメーション API
- CSS アニメーション
- CSS トランジション
Element.getAnimations()
- 単一の要素 (Element
) とその子孫にあるアニメーションのみを読み取るAnimation