Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年3月.
Animation() はウェブアニメーション API のコンストラクターで、新しい Animation オブジェクトのインスタンスを返します。
アニメーションに割り当てる、 AnimationEffect インターフェイスに基づくオブジェクトとして対象となる効果です。将来的には SequenceEffect や GroupEffect などの他の効果も利用できるようになるかもしれませんが、現在のところ利用できる効果は KeyframeEffect だけです。これは null (これが既定値です)にすると、効果を適用しないことを示します。
timeline 省略可アニメーションを関連付ける timeline を指定します。 AnimationTimeline インターフェイスに基づく型のオブジェクトを指定します。現在利用できるタイムラインは DocumentTimeline だけですが、将来的にはジェスチャーやスクロールに関連するタイムラインも利用できるようになるかもしれません。既定値は Document.timeline ですが、null に設定することも可能です。
「白兎を追え」の例では、 Animation() コンストラクターを使用して Animation を rabbitDownKeyframes に対して、文書の timeline を使用して生成しています。
| Web Animations # dom-animation-animation |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2024年5月18日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.