AnimationEvent()

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

구문

animationEvent = new AnimationEvent(type, {animationName: aPropertyName,
                                            elapsedTime  : aFloat,
                                            pseudoElement: aPseudoElementName});

매개변수

AnimationEvent() 생성자는 Event() 생성자의 매개변수도 상속합니다.

type

AnimationEvent의 유형을 나타내는 대소문자 구별 DOMString입니다. 'animationstart', 'animationend', 'animationiteration'을 사용할 수 있습니다.

animationName Optional

트랜지션에 관련된 animation-name (en-US) CSS 속성 값을 나타내는 DOMString입니다. 기본 값은 ""입니다.

elapsedTime Optional

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

pseudoElement Optional

애니메이션이 재생된 의사 요소의 이름을 값으로 가진 DOMString입니다. '::'으로 시작합니다. 의사 요소가 아닌 요소에서 재생된 애니메이션에서는 빈 문자열('')을 반환합니다.

반환 값

지정한 옵션에 따라 새롭게 생성한 AnimationEvent.

명세

Specification
CSS Animations Level 1
# dom-animationevent-animationevent

브라우저 호환성

BCD tables only load in the browser

같이 보기