<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function my_yincang(check_div){
var mydiv=document.getElementById(check_div);
mydiv.style.display="none";
var bw=document.getElementById("my_bgDiv");
document.body.removeChild(bw);
}
function my_xianshi(play){
var mydiv=document.getElementById(play);
mydiv.style.display="";
//mydiv.style.top=(document.body.offsetHeight-350)/2+"px";
//mydiv.style.top=(document.body.clientHeight-350)/2+document.body.scrollTop+"px";
mydiv.style.top=document.documentElement.scrollTop+100+"px";
mydiv.style.left=(document.body.clientWidth-700)/2+"px";
var My_bgObj=document.createElement("div");
My_bgObj.setAttribute('id','my_bgDiv');
My_bgObj.style.position="absolute";
My_bgObj.style.top="0";
My_bgObj.style.background="#777";
My_bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
My_bgObj.style.opacity="0.6";
My_bgObj.style.left="0";
My_bgObj.style.zIndex=2;
My_bgObj.style.width=document.body.clientWidth+"px";
My_bgObj.style.height=document.body.clientHeight+"px";
document.body.appendChild(My_bgObj);
}
</SCRIPT>
</head>
<body>
<input type="button" value="显示" onClick="my_xianshi('hhh')"/>
<input type="button" value="隐藏" onClick="my_yincang('hhh')"/>
<div style="background-color:#0033FF; width:500px; height:500px; z-index:10; display:none;position: absolute;" id="hhh"></div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function my_yincang(check_div){
var mydiv=document.getElementById(check_div);
mydiv.style.display="none";
var bw=document.getElementById("my_bgDiv");
document.body.removeChild(bw);
}
function my_xianshi(play){
var mydiv=document.getElementById(play);
mydiv.style.display="";
//mydiv.style.top=(document.body.offsetHeight-350)/2+"px";
//mydiv.style.top=(document.body.clientHeight-350)/2+document.body.scrollTop+"px";
mydiv.style.top=document.documentElement.scrollTop+100+"px";
mydiv.style.left=(document.body.clientWidth-700)/2+"px";
var My_bgObj=document.createElement("div");
My_bgObj.setAttribute('id','my_bgDiv');
My_bgObj.style.position="absolute";
My_bgObj.style.top="0";
My_bgObj.style.background="#777";
My_bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
My_bgObj.style.opacity="0.6";
My_bgObj.style.left="0";
My_bgObj.style.zIndex=2;
My_bgObj.style.width=document.body.clientWidth+"px";
My_bgObj.style.height=document.body.clientHeight+"px";
document.body.appendChild(My_bgObj);
}
</SCRIPT>
</head>
<body>
<input type="button" value="显示" onClick="my_xianshi('hhh')"/>
<input type="button" value="隐藏" onClick="my_yincang('hhh')"/>
<div style="background-color:#0033FF; width:500px; height:500px; z-index:10; display:none;position: absolute;" id="hhh"></div>
</body>
</html>