pointer-events

介绍

CSS 属性 pointer-events 指定元件是否能够响应触摸事件。

使用示例

语法

pointer-events: auto;
pointer-events: none;

取值

  • auto

    默认值,此时,节点可以响应触摸事件。

  • none

    节点不能响应触摸事件。

形式定义

初始值auto
适用元素all elements that don't override hitTest
是否支持继承no
是否支持动画no

形式语法

pointer-events: auto | none;

与 Web 的区别

不支持 inheritinitialunset,不存在 visiblePaintedrollvisibleFillSVG only 的属性值。

注意事项

  • 该属性有继承效果,即当子节点没有设置 pointer-events 时,会继承父节点的 pointer-events 值。

兼容性

LCD tables only load in the browser

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。