--- title: GlobalEventHandler.onanimationend slug: Web/API/GlobalEventHandlers/onanimationend translation_of: Web/API/GlobalEventHandlers/onanimationend ---

概述

事件处理程序。 当CSS动画到达其活动期的结束时发送此事件

语法

var animEndHandler = target.onanimationend;

target.onanimationend = 事件处理函数

target(HTML元素, document 或者 window)的CSS动画已经开始,{{event("animationend")}}事件会触发同时事件处理函数会被调用。事件处理函数会接收到唯一的参数:{{domxref("AnimationEvent")}} 描述发生的事件。

例子

{{Page("/en-US/docs/Web/API/GlobalEventHandlers/onanimationstart", "Example")}}

规范

Specification Status Comment
{{SpecName('CSS3 Animations','#eventdef-animationevent-animationend','onanimationend')}} {{Spec2('CSS3 Animations')}}  

浏览器兼容性

{{Compat("api.GlobalEventHandlers.onanimationend")}}

参考