<div style="width: 100px; height: 25px; position: relative;">
<input type="button" style="width: 100px; height: 25px;" onclick="alert(1);" value="Input"/>
<div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3;"></div>
</div>
<br/>
<div style="width: 100px; height: 25px; position: relative;">
<button style="width: 100px; height: 25px;" onclick="alert(1);">Button</button>
<div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3;"></div>
</div>
当我在 Opera 11.01 中单击第一个按钮(<input>)时,按钮不会被按下,因为下一个
最佳答案
尝试在 div 上添加 z 索引
<div style="width: 100px; height: 25px; position: relative;">
<button style="width: 100px; height: 25px;" onclick="alert(1);">Inpute</button>
<div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3; z-indeX: -1;"></div>
</div>
<br/>
<div style="width: 100px; height: 25px; position: relative;">
<button style="width: 100px; height: 25px;" onclick="alert(1);">Button</button>
<div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3; z-index: -1;"></div>
</div>
更新:JsFiddle
关于javascript - Opera pass 单击重叠按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5612757/