单击位于较高z-index div下方的链接 [英] click link below a higher z-index div

查看:91
本文介绍了单击位于较高z-index div下方的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

  #bottom {
width:100px;
height:100px;
background-color:orange;
}

#top {
width:50px;
height:50px;
position:absolute;
left:0;
top:0;
background-color:rgba(255,0,0,.5);
}


解决方案

pointer-events:none



请参阅: http://jsfiddle.net/LNwHV/ 1 /



浏览器支持: http://caniuse.com/指针事件(除了IE10和更旧版本以外的所有地方)



要支持旧版本的IE,必须使用JavaScript 作为后备。


Possible Duplicate:
Passing mouse clicks through an overlaying element <div>

Is it possible to click the link below the red square without javascript? The red div doesn't need to be clickable.

http://jsfiddle.net/efortis/LNwHV/

#bottom{
 width: 100px;
 height: 100px;
 background-color: orange;
}

#top{
  width: 50px;
  height: 50px;
  position: absolute;
  left:0;
  top:0;
  background-color: rgba(255,0,0,.5);
 }

解决方案

The CSS method to do this is pointer-events: none

See: http://jsfiddle.net/LNwHV/1/

Browser support: http://caniuse.com/pointer-events (works everywhere except IE10 and older)

To support old versions of IE, you'll have to use JavaScript as a fallback.

这篇关于单击位于较高z-index div下方的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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