Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Animation
  4. finished

Animation: finished property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2020.

TheAnimation.finished read-only property of theWeb Animations API returns aPromise which resolves once the animation has finished playing.

Note:Every time the animation leaves thefinished play state (that is, when it starts playing again), a newPromise is created for this property. The newPromise will resolve once the new animation sequence has completed.

Value

APromise object which will resolve once the animation has finished running.

Examples

The following code waits until all animations running on the elementelem have finished, then deletes the element from the DOM tree:

js
Promise.all(elem.getAnimations().map((animation) => animation.finished)).then(  () => elem.remove(),);

Specifications

Specification
Web Animations
# dom-animation-finished

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp