sự kiện hoạt hìnhend
Ví dụ
Làm điều gì đó khi hoạt ảnh CSS kết thúc:
const div1 = document.getElementById("myDIV");
div1.addEventListener("animationend", myEndFunction);
Hãy tự mình thử »Sự miêu tả
Sự kiện animationend
xảy ra khi hoạt ảnh CSS đã hoàn tất .
Sự kiện hoạt hình
Event | Occurs When |
---|---|
animationstart | A CSS animation has started |
animationend | A CSS animation has completed |
animationiteration | A CSS animation is repeated |
Thuộc tính hoạt hình
Property | Description |
---|---|
animationName | The name of the animation |
elapsedTime | The number of seconds an animation has been running |
pseudoElement | The name of the pseudo-element of the animation |
Xem thêm:
Đối tượng sự kiện hoạt hình
Thuộc tính hoạt hình Phong cách
Hướng dẫn:
Chi tiết kỹ thuật
Bong bóng: | Đúng |
---|---|
Có thể hủy: | KHÔNG |
Loại sự kiện: | Hoạt hìnhSự kiện |
Phiên bản DOM: | Sự kiện cấp 3 |
Hỗ trợ trình duyệt
onanimationend
là tính năng DOM Cấp 3 (2004).
Nó được hỗ trợ đầy đủ trong tất cả các trình duyệt hiện đại:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |