'指针事件:无'不与IE合作 [英] 'Pointer-events: none' not working with IE

查看:92
本文介绍了'指针事件:无'不与IE合作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的HTML页面上有一个锚元素,这是在一些条件声明下:



@if(someCondition)

{

Hi,

I have an anchor element placed on my HTML page, which is under some conditional statement:

@if(someCondition)
{

<span class="iop-plan"><a id="IOP-InPlan" class="inactiveLink" >IOP - In Plan</a></span>





}





CSS:

a.inactiveLink {

指针 - 事件:无;

光标:默认;

颜色:#333333;

}







我的目的是在条件满足时禁用/不可点击锚链接。因此我在CSS中放置了指针事件:无。但是,它似乎不适用于Internet Explorer。它正在与所有其他浏览器(Chrome,Mozilla)合作。



请帮助。



< b>我尝试了什么:



在互联网上阅读之后,我尝试了把锚元素放在SVG标签内的东西,因为有人建议IE使用SVG识别指针事件:无。但是,它没有用。



}


CSS:
a.inactiveLink {
pointer-events: none;
cursor: default;
color: #333333;
}



My aim is to make the anchor link disabled/non-clickable if the condition satisfies. Therefore I have placed the pointer-events: none in CSS. However, it doesn't seem to work with Internet Explorer. It is working with all the other browsers (Chrome, Mozilla).

Kindly help.

What I have tried:

After reading on internet, I tried things like putting the anchor element inside SVG tag, as people have suggested that IE does identify pointer-events: none with SVG. However, it didnt work.

推荐答案

在版本11之前的IE中不支持指针事件 CSS属性...
The pointer-events CSS property not supported in IE before version 11...


而不是使用css,尝试使用jquery设置attr / prop

如果你正在使用jQuery< 1.6,执行此操作:


Instead of doing it using css , try to set attr/prop using jquery
If you are using jQuery < 1.6, do this:


('#deleteclientajaxformlink')。attr(disabled,disabled);

如果您使用的是jQuery 1.6+:


('#deleteclientajaxformlink').attr("disabled", 'disabled');
If you are using jQuery 1.6+:


这篇关于'指针事件:无'不与IE合作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆