IE 的 css 'pointer-events' 属性替代 [英] css 'pointer-events' property alternative for IE

查看:49
本文介绍了IE 的 css 'pointer-events' 属性替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉导航菜单,其中一些标题在点击时不应导航到其他页面(这些标题在点击时打开一个下拉菜单),而其他标题应该导航(这些没有下拉菜单并直接导航).但是,这两种类型都为它们定义了 href

I have a drop down navigation menu in which some of the title should not navigate to other page when clicked(these title open a drop down menu when clicked on) while others should navigate (these dont have dropdown and navigate directly).However, both types have href defined to them

为了解决这个问题,我为前一种类型的标题添加了以下css

To solve this i added the following css for the former type of titles

pointer-events: none;

并且它工作正常.但是由于 IE 不支持此属性,我正在寻找一些解决方法.令人讨厌的是我没有完全更改 HTML 和 JavaScript 代码的访问权限和特权.

and it is working fine.But since this property is not supported by IE, i am looking for some work-around. The annoying thing is that i don't have access and privilege to change the HTML and JavaScript code completely.

有什么想法吗?

推荐答案

Pointer-events 是一个 Mozilla hack,它已经在 Webkit 浏览器中实现,你不能指望再过百万年才能在 IE 浏览器中看到它.

Pointer-events is a Mozilla hack and where it has been implemented in Webkit browsers, you can't expect to see it in IE browsers for another million years.

但是我找到了一个解决方案:

There is however a solution I found:

通过层转发鼠标事件

这使用了一个插件,该插件使用一些不太为人所知/理解的 Javascript 属性来获取鼠标事件并将其发送到另一个元素.

This uses a plugin that uses some not well known/understood properties of Javascript to take the mouse event and send it to another element.

还有另一个 Javascript 解决方案这里.

There is also another Javascript solution here.

2013 年 10 月更新:显然它会在 v11 中加入 IE.来源.谢谢蒂姆.

Update for October 2013: apparently it's coming to IE in v11. Source. Thanks Tim.

这篇关于IE 的 css 'pointer-events' 属性替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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