开发者

Biggest z-index but still "transparent"?

Is there a way to click through element, even if it's on top of the others. I have a link under one div, and the div must be where it is, but link should of course be clickable.

Solutions? Even jQuery is okay, if impossible with CSS.

开发者_开发百科Martti Laine

EDIT: I cannot add link higher, because the div here is a kind of overlay/glare.


With some Javascript you can add another a element with a higher z-index and absolutely position it over the location of the original link.


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?


I've done this kind of thing before transmitting mouse coordinates with clicks and determining what was under the div, then sending a click to that element. But that was with only a few clickable items. I wouldn't want to do that for a complicated arrangement.


add this css rule

a {
    z-index: 999; /* greater than top most div */
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜