小智 6
为了能够点击div,请使用以下内容
$('#front-div').click(function (e) {
$(this).hide();
$(document.elementFromPoint(e.clientX, e.clientY)).trigger("click");
$(this).show();
});
$(".tobeclicked").click(function(){
$("#result").append("clicked<br />");
});
Run Code Online (Sandbox Code Playgroud)
小智 0
如果使用具有高 z-index 的内部 DIV 会怎样?例如:
<style>
.sub {
position: relative;
background: #99f;
width: 100px;
height: 100px;
}
.top {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 2;
}
.opacityLayer {
position: absolute;
background: #fff;
width: 100px;
height: 100px;
opacity: 0.5;
left: 30px;
top: 30px;
}
</style>
<a href="#"><div class="sub"><div class="top"></div></div></a>
<div class="opacityLayer"></div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12143 次 |
| 最近记录: |