罪恶都市汉化硬盘版:求助:如何将网页中某一个层置于最上层,其他层不能被鼠标操作?

来源:百度文库 编辑:高校问答 时间:2024/04/28 05:24:59
求助:如何将网页中某一个层置于最上层,其他层不能被鼠标操作?

看看以下的实现方法:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html" charset="gb2312">
</head>

<body leftmargin=0 topmargin=0>
<div id="bgLayer" style="position:absolute;background:#CCCCCC;top:0px;width:100%;height:100%;filter:alpha(style=0,opacity=50);display:none;z-index:9998;"> </div>
<div id="topLayer" style="position:absolute;background:#999999;top:0px;width:420px;height:150px;display:none;z-index:9999;">
<table width=100% height=100% bgcolor="#FFFFFF" style="position:relative;top:-5px;left:-5px;border:solid #999999 1px;">
<tr>
<td><center><input type="button" value="确 定" onclick="javaScript:hideEdit();"></center></td>
</tr>
</table>
</div>
<br><br><br>
<p>
<center>
<input type="button" value="显 示" onclick="javaScript:showEdit();">
</center>
<script language="JavaScript">
<!--
function showEdit(id){
document.all["bgLayer"].style.display="";
document.all["bgLayer"].style.height=document.body.scrollHeight;
document.all["topLayer"].style.display="";
timer=setInterval(move,"50");
}
function hideEdit(){
clearInterval(timer);
document.all["bgLayer"].style.display="none";
document.all["topLayer"].style.display="none";
}
function move(){
document.all["topLayer"].style.top=document.body.scrollTop+document.body.clientHeight/2-110;
document.all["topLayer"].style.left=document.body.scrollLeft+document.body.clientWidth/2-200;
}
//-->
</script>
</body>
</html>