“pointer-events:none”在IE9和IE10中不起作用

时间:2014-05-22 05:57:20

标签: css internet-explorer

早上好, 我想将一个链接设为不可点击 这是我的css

         .disable {
            pointer-events: none;
            cursor: not-allowed !important;
            opacity: 0.5;
          }

此代码适用于Mozilla Firefox和Chrome,但不适用于IE 9或IE 10。 所以我想问一下pointer-events: none;这个属性是否有任何选项。

2 个答案:

答案 0 :(得分:4)

IE9 / 10不支持

指针事件。它只支持IE11。 请看这个链接:http://caniuse.com/#feat=pointer-events

答案 1 :(得分:0)

这是代码:

HTML:

<a href="#" class="disable">test</a>

jQuery的:

$(document).ready(function(){
    $(".disable").on("click",function(e){
        e.preventDefault();
    })

});

CSS:

.disable,.disable:active {
      cursor:default;
      opacity: 0.5;
      color:blue; 

}
相关问题