--- title: AnimationEvent slug: Web/API/AnimationEvent tags: - AnimationEvent translation_of: Web/API/AnimationEvent ---
{{SeeCompatTable}}{{APIRef("Web Animations API")}}
AnimationEvent
接口表示提供与动画相关的信息的事件。
{{InheritanceDiagram}}
属性继承其父级{{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: ''
.
AnimationEvent
event with the given parameters.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', '#AnimationEvent-interface', 'AnimationEvent') }} | {{ Spec2('CSS3 Animations') }} | Initial definition. |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 {{ property_prefix("webkit") }} | {{ CompatGeckoDesktop("6.0") }} | 10.0 | 12 {{ property_prefix("o") }} 12.10 (without prefix) 15.0 {{ property_prefix("webkit") }} |
4.0 {{ property_prefix("webkit") }} |
AnimationEvent() constructor |
{{CompatNo}} | {{ CompatGeckoDesktop("23.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
initAnimationEvent() {{non-standard_inline}}{{deprecated_inline}} |
1.0 | {{ CompatGeckoDesktop("6.0") }} Removed in {{ CompatGeckoDesktop("23.0") }} |
10.0 | 12 | 4.0 |
pseudoelement |
{{CompatNo}} | {{ CompatGeckoDesktop("23.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}}{{ property_prefix("webkit") }} | {{ CompatGeckoMobile("6.0") }} | 10.0 | 12 {{ property_prefix("o") }} 12.10 (without prefix) 15.0 {{ property_prefix("webkit") }} |
{{CompatVersionUnknown}}{{ property_prefix("webkit") }} |
AnimationEvent() constructor |
{{CompatNo}} | {{ CompatGeckoMobile("23.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
initAnimationEvent() {{non-standard_inline}}{{deprecated_inline}} |
{{CompatVersionUnknown}} | {{ CompatGeckoMobile("6.0") }} Removed in {{ CompatGeckoMobile("23.0") }} |
10.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
pseudoelement |
{{CompatNo}} | {{ CompatGeckoMobile("23.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |