div点击穿透,上层的点击作用不起作用
html
<div class="aa">
</div>
<div class="bb">
</div>
.aa{
position: absolute;
top:0;
width:100px;
height: 100px;
}
.bb{
position: absolute;
top:0;
width:100px;
height: 100px;
pointer-events: none;
}
pointer-events: none;鼠标事件设置为none即可;
阻止穿透
在js的点击事件里面添加这句话,阻止冒泡
event.stopPropagation();