Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CSSAnimation

CSSAnimation

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

TheCSSAnimation interface of theWeb Animations API represents anAnimation object.

EventTarget Animation CSSAnimation

Instance properties

This interface inherits properties from its parent,Animation.

CSSAnimation.animationNameRead only

Returns the animation name as a string.

Instance methods

This interface inherits methods from its parent,Animation.

Examples

Inspecting the returned CSSAnimation

The animation in the following example is defined in CSS with the nameslide-in. CallingElement.getAnimations() returns an array of allAnimation objects. In our case this returns aCSSAnimation object, representing the animation created in CSS.

css
.animate {  animation: slide-in 0.7s both;}@keyframes slide-in {  0% {    transform: translateY(-1000px);  }  100% {    transform: translateY(0);  }}
js
let animations = document.querySelector(".animate").getAnimations();console.log(animations[0]);

Specifications

Specification
CSS Animations Level 2
# the-CSSAnimation-interface

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp