楼上的,给个代码
<html>
<head>
<title>test</title>
<script language="javascript" type="text/javascript">
function openDiv()
{
sWidth=document.body.offsetWidth;
sHeight=screen.height;
var bgObj = document.getElementById('divBG');
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=2,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.5";
bgObj.style.width = sWidth;
bgObj.style.height = sHeight;
bgObj.style.display="inline";
var bgObjCtrl = document.getElementById('divCtrl');
bgObjCtrl.style.width = sWidth;
bgObjCtrl.style.display="inline";
document.all("b1").disabled=true;
}
function closeDiv()
{
divBG.style.display="none";
divCtrl.style.display="none";
document.all("b1").disabled=false;
}
</script>
</head>
<body>
<div>
<a id="b1" onclick="openDiv();" style="cursor:hand; color:Blue;">点一下</a>
</div>
<div id="divBG"
style="display:none; position: absolute; left:0px; top:0px; background-color:#C0C0C0;">
</div>
<div id="divCtrl" class="" style="display:none; position: absolute; background-color:Transparent; width:400px; top:0px; left:200px;">
<table width="100%">
<tr>
<td style="height:180px;"></td>
</tr>
<tr>
<td>
<table id="tb1" style="background-color:#C6D5F5; width:280px; border-color:#999999" border="0px"; cellpadding="0" cellspacing="1">
<tr>
<td align="right" ><a onclick="closeDiv();" style="cursor:hand"><B><font color="red">关闭</font></B> </a></td>
</tr>
<tr>
<td style="background-color:White;"></td>
</tr>
<tr>
<td align="center" style="background-color:White; width:35%"><br />这是你刚刚打开的层<br /></td>
</tr>
<tr>
<td colspan="2" style="background-color:#D4D4D4; height:15px;"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>