Thuộc tính định hướng hoạt hình theo phong cách
Ví dụ
Thay đổi thuộc tính animationDirection của phần tử <div>:
document.getElementById("myDIV").style.animationDirection = "reverse";
Hãy tự mình thử »Sự miêu tả
Thuộc tính animationDirection đặt hoặc trả về việc hoạt ảnh có nên phát ngược lại theo các chu kỳ thay thế hay không.
Lưu ý: Nếu hoạt ảnh được đặt chỉ phát một lần, thuộc tính này sẽ không có hiệu lực.
Cú pháp
Trả về thuộc tính animationDirection:
object .style.animationDirection
Đặt thuộc tính animationDirection:
object .style.animationDirection = "normal|reverse|alternate|alternate-reverse|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
normal | Default value. The animation should be played as normal |
reverse | The animation should play in reverse direction |
alternate | The animation will be played as normal every odd time (1,3,5,etc..) and in reverse direction every even time (2,4,6,etc...) |
alternate-reverse | The animation will be played in reverse direction every odd time (1,3,5,etc..) and in a normal direction every even time (2,4,6,etc...) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Chi tiết kỹ thuật
Giá trị mặc định: | Bình thường |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị thuộc tính animation-direction của một phần tử |
Phiên bản CSS | CSS3 |
Hỗ trợ trình duyệt
animationDirection
là một tính năng CSS3 (1999).
Nó được hỗ trợ đầy đủ trong tất cả các trình duyệt:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
Trang liên quan
Tham chiếu CSS: thuộc tính hướng hoạt ảnh