1

有没有办法点击元素,即使它在其他元素之上。我在一个 div 下有一个链接,该 div 必须在它所在的位置,但链接当然应该是可点击的。

解决方案?即使 jQuery 也可以,如果 CSS 不可能的话。

马蒂莱恩

编辑:我不能添加更高的链接,因为这里的 div 是一种覆盖/眩光。

4

4 回答 4

2

使用一些 Javascript,您可以添加另一个a具有更高 z-index 的元素,并将其绝对定位在原始链接的位置上。

于 2010-03-21T17:13:19.930 回答
0

The only solution that will not result in hacking until the end of time is to either promote the link to a higher z-index or hide the div. Trying to track coordinates feels like an impossible solution.

Is there a reason you cannot promote the links to a higher stack index?

于 2010-03-21T16:56:05.230 回答
0

在通过单击传输鼠标坐标并确定 div 下的内容,然后向该元素发送单击之前,我已经完成了这种事情。但那只是几个可点击的项目。对于复杂的安排,我不想这样做。

于 2010-03-21T17:16:41.530 回答
0

添加此 CSS 规则

a {
    z-index: 999; /* greater than top most div */
}
于 2010-03-21T17:39:01.837 回答