我有一个浮动层
<div id="1" style="overflow:auto">
<div id="2" style="display:none;">
</div>
</div>
但是这个隐藏的层在隐藏的时候却把底下页面的文本框覆盖了,鼠标点击文本框不能获取焦点了,还变成了箭头。好苦恼呀!!!
各位高人们请帮帮我好么? 冬天了,雪地裸体跪求~~~~~~~~~~~~~~~~```
<div id="1" style="overflow:auto">
<div id="2" style="display:none;">
</div>
</div>
但是这个隐藏的层在隐藏的时候却把底下页面的文本框覆盖了,鼠标点击文本框不能获取焦点了,还变成了箭头。好苦恼呀!!!
各位高人们请帮帮我好么? 冬天了,雪地裸体跪求~~~~~~~~~~~~~~~~```
用top和left定位,然后用z-index调节层的叠盖次序。
<div id="2" style="display:none; z-index:-2;">
</div>
</div>
我用了z-index了,现在文本框可以点击了,就是显示不出层,我该怎么办呢
<div id="1" style="overflow:auto;z-index:-1;">
<div id="2" style="display:none;z-index:-1;">
<div id="3">
<SPAN title=关闭 style=‘float:right; MARGIN-RIGHT: 4px'onclick="aaa()">×</SPAN>
</div>
</div>
</div>
当点击检索按钮时调用search()方法来打开层
<input id="1" type="button" name="btn" value="检索" onclick="search();this.blur();" />
~~~~~~~可以帮我看看么,谢谢拉呵呵
<!--
function aaa(p)
{
if(p==1)
document.getElementById('2').style.display="none";
else
document.getElementById('2').style.display="";
}
//-->
</script>
<body>
<div id="1" style="width:400px;height:300;border: 1px dashed #0099CC;overflow:auto;z-index:-1;">
<div id="2" style="border: 1px dashed #00ffCC;display:'';z-index:1;">
<SPAN title=关闭 style='float:right; MARGIN-RIGHT: 4px ;cursor:hand'onclick="aaa(1)"> × </SPAN>
<div id="3" style="border: 1px dashed #ffffCC;display:'';z-index:2;"> <!-- 放置内容--> <table>
<tr>
<td>dsaf</td>
<td>sdfsaf</td>
</tr>
<tr>
<td>sfas</td>
<td>asdfasd</td>
</tr>
<tr>
<td>asdfas</td>
<td>asfs</td>
</tr>
</table> </div>
</div>
</div>
<form>
<input id="1" type="button" name="btn" value="检索" onclick="aaa(2);this.blur();" />
</form>
</body>
<!--
function aaa(p)
{
var dis;
if(p==1)
{
dis=document.getElementById('1');
dis.style.display="none";
document.getElementById('3').href="javascript:aaa(2)";
}
else
{
document.getElementById('1').style.display="";
document.getElementById('3').href="javascript:aaa(1)";
}
}
//-->
</script>
<body>
<div id="0" >
<h3 style="height:20px;">
<a id="3" href="javascript:aaa(1)" style="height:20px;width:400px;background:#f00;">标题</a>
</h3>
<div id="1" style="width:400px;height:200;border:1px dashed #0099CC;margin-top:1px;">
</div>
</div>
<div style="width:400px;height:200;border:1px dashed #0099CC;background:#f00;">
</div>
</body>