pointer-events:none;

简介:
http://www.zhangxinxu.com/wordpress/2011/12/css3-pointer-events-none-javascript/

pointer-events:  auto | none
  • auto——效果和没有定义pointer-events属性相同,鼠标不会穿透当前层。在SVG中,该值和visiblePainted的效果相同。

  • none——元素不再是鼠标事件的目标,鼠标不再监听当前层而去监听下面的层中的元素。但是如果它的子元素设置了pointer-events为其它值,比如auto,鼠标还是会监听这个子元素的。

  • 其它属性值为SVG专用,这里不再多介绍了。


浏览器兼容性

Firefox 3.6+和chrome 2.0+ 以及safari 4.0+都支持这个CSS3属性,IE6/7/8/9都不支持,Opera在SVG中支持该属性但是HTML中不支持。好吧,还是有点儿悲催~~


用途1:pointer-events:none;+无href 可做不可点状态

用途2:在定位层上加pointer-events:none;可穿透 定位层下面的内容可选可点



      本文转自Ansue  51CTO博客,原文链接:http://blog.51cto.com/ansue/1735382,如需转载请自行联系原作者


目录
打赏
0
0
0
0
348
分享
相关文章
mark 和 reset
mark 和 reset
109 0
Using ‘value‘ pointer is unsafe and deprecated. Use NULL as value pointer. To fetch trackbar value s
本文讨论了OpenCV中使用`createTrackbar`时遇到的"Using ‘value’ pointer is unsafe and deprecated"警告,并提供了通过设置空指针或使用回调函数来解决这个问题的方法。
Using ‘value‘ pointer is unsafe and deprecated. Use NULL as value pointer. To fetch trackbar value s
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
malloc(): corrupted top size
malloc(): corrupted top size
1262 0