Thuộc tính con trỏ-sự kiện CSS
Thí dụ
Đặt xem một phần tử có nên phản ứng với các sự kiện con trỏ hay không:
div.ex1 {
pointer-events: none;
}
div.ex2 {
pointer-events: auto;
}
Định nghĩa và Cách sử dụng
Thuộc pointer-events
tính xác định xem một phần tử có phản ứng với các sự kiện con trỏ hay không.
Giá trị mặc định: | Tự động |
---|---|
Thừa hưởng: | Đúng |
Hoạt hình: | Không. Đọc về hoạt ảnh |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | đối tượng .style.pointerEvents = "none" |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
pointer-events | 2.0 | 11.0 | 3.6 | 4.0 | 9.0 |
Cú pháp CSS
pointer-events: auto|none;
Giá trị tài sản
Property Value | Description |
---|---|
auto | The element reacts to pointer events, like :hover and click. This is default |
none | The element does not react to pointer events |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |