chrome 和 safari 中无法点击的链接和按钮
由于它们具有相同的渲染引擎,因此两者都会出现此问题。它在 IE7/8/9、FF 中运行良好。我正在使用 chrome 17 和 safari 5。这是我的整个代码。请注意,您不能同时单击按钮和链接。(您必须单击 img
才能显示元素)
<script type="text/javascript">
function showDrop(){
document.getElementById('droplist').style.display="block";
}
function hideDrop(){
document.getElementById('droplist').style.display="none";
}
</script>
<style>
body{
direction:rtl;
}
#droplistImg{
border-left:1px solid #000000;
border-right:1px solid #000000;
border-top:1px solid #000000;
padding:3px;
background:#c0c0c0;
float:right;
}
#droplistinfo{
border:1px solid #000000;
position:absolute;
z-index:-1;
left: 0;
top:20px;
background:#c0c0c0;
}
#droplist{
width: 101px;
position: relative;
}
</style>
<div id="droplist" style="position:absolute;display:none;">
<div id="droplistImg" ><img src="images/stats.png"/></div>
<div id="droplistinfo">
<input type="button" value="phone num"/>
<input type="button" value="fax num"/>
<a style="float:left;" href="javascript:hideDrop()">close</a>
</div>
</div>
<img src="images/stats.png" onclick="showDrop()"/>
since they have same rendering engine, this problem shows in both. it works great in IE7/8/9, FF. I'm using chrome 17 and safari 5. here is my whole code. see you can't click both the buttons and the link.(you have to click on the img
to show the elements)
<script type="text/javascript">
function showDrop(){
document.getElementById('droplist').style.display="block";
}
function hideDrop(){
document.getElementById('droplist').style.display="none";
}
</script>
<style>
body{
direction:rtl;
}
#droplistImg{
border-left:1px solid #000000;
border-right:1px solid #000000;
border-top:1px solid #000000;
padding:3px;
background:#c0c0c0;
float:right;
}
#droplistinfo{
border:1px solid #000000;
position:absolute;
z-index:-1;
left: 0;
top:20px;
background:#c0c0c0;
}
#droplist{
width: 101px;
position: relative;
}
</style>
<div id="droplist" style="position:absolute;display:none;">
<div id="droplistImg" ><img src="images/stats.png"/></div>
<div id="droplistinfo">
<input type="button" value="phone num"/>
<input type="button" value="fax num"/>
<a style="float:left;" href="javascript:hideDrop()">close</a>
</div>
</div>
<img src="images/stats.png" onclick="showDrop()"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道出了什么问题。当我删除它时,它是
z-index
,它工作正常。我改变了一些东西,现在效果很好。I knew what's the issue. it's the
z-index
when I remove it, it works fine. I changed some things and it works great now.