gpt4 book ai didi

javascript - Opera pass 单击重叠按钮

转载 作者:行者123 更新时间:2023-11-28 10:21:11 25 4
gpt4 key购买 nike

<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>)时,按钮不会被按下,因为下一个

与 <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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com