AnimationEvent: AnimationEvent() 생성자

AnimationEvent() 생성자는 애니메이션에 관련된 이벤트를 나타내는 AnimationEvent 객체를 새로 생성하고 반환합니다.

구문

js
new AnimationEvent(type)
new AnimationEvent(type, options)

매개변수

type

AnimationEvent의 유형을 나타내는 문자열입니다. 대소문자를 구분하며 브라우저는animationstart, animationend, animationiteration을 사용합니다.

options Optional

Event()에서 사용할 수 있는 속성에 더해 다음 속성들도 포함하는 객체입니다.

animationName Optional

트랜지션에 연관된 animation-name (en-US) CSS 속성 값을 담은 문자열입니다. 기본 값은 ""입니다.

elapsedTime Optional

이 이벤트가 발생한 시점까지 애니메이션이 재생된 총 시간을 나타내는 float 값입니다. 초 단위며, 애니메이션이 일시중지됐던 시간은 제외합니다. animationstart 이벤트의 elapsedTimeanimation-delay의 값이 음수인 경우에만 (-1 * delay)가 되고, 그 외에는 0.0입니다.

pseudoElement Optional

애니메이션이 재생 중인 의사 요소의 이름을 담은, '::'으로 시작하는 문자열입니다. 애니메이션이 일반 요소에서 재생 중이라면 빈 문자열('')을 반환합니다.

명세서

Specification
CSS Animations Level 1
# dom-animationevent-animationevent

브라우저 호환성

BCD tables only load in the browser

같이 보기