如何透过上层div点击下层的元素

要通过上面遮屏层触发下面的点击事件, 遮屏层样式加:   pointer-events: none; //重要这个属性

<body>
    <div class="btnGroup" onclick="resetMapSize()"><i class="windeows"> </i></div>
    <div class="iframeMapMark"></div>
    <div id="container"></div>
</body>
<style>
.iframeMapMark{width: 100%; height: 100%; position:absolute;background: radial-gradient(90% 90%,rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,1),rgba(0,0,0,1) 100%); z-index: 2; pointer-events: none;}
</style>

猜你喜欢

转载自blog.csdn.net/qq_39704803/article/details/116935314