--- title: AnimationEvent slug: Web/API/AnimationEvent tags: - API - Experimental - Interface - NeedsTranslation - Reference - TopicStub - Web Animations translation_of: Web/API/AnimationEvent ---
The AnimationEvent
interface represents events providing information related to animations.
{{InheritanceDiagram}}
AnimationEvent
event with the given parameters.Also inherits properties from its parent {{domxref("Event")}}.
float
giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an animationstart
event, elapsedTime
is 0.0
unless there was a negative value for {{cssxref("animation-delay")}}, in which case the event will be fired with elapsedTime
containing (-1 * delay)
.'::'
, containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: ''
.Also inherits methods from its parent {{domxref("Event")}}.
AnimationEvent
created using the deprecated {{domxref("Document.createEvent()", "Document.createEvent(\"AnimationEvent\")")}} method.Specification | Status | Comment |
---|---|---|
{{SpecName("CSS3 Animations", "#interface-animationevent", "AnimationEvent")}} | {{Spec2("CSS3 Animations")}} | Initial definition. |
{{Compat("api.AnimationEvent")}}