div遮挡层

<style type="text/css">
<!--
html, body {
	height:100%;
	margin:0px;
	font-size:12px;
}
.mydiv {
	background-color: #f9fff6;
	border: 1px solid #009900;
	text-align: center;
	line-height: 25px;
	font-size: 13px;
	font-weight: bold;
	z-index:99;
	width: 300px;
	height: 50px;
	left:50%;/*FF IE7*/
	top:50%;/*FF IE7*/
	margin-left:-150px!important;/*FF IE7 half of its width */
	margin-top:-60px!important;/*FF IE7 half of its height*/
	margin-top:0px;
	position:fixed!important;/*FF IE7*/
	position:absolute;/*IE6*/
 _top:       expression(eval(document.compatMode &&  document.compatMode=='CSS1Compat') ?  documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
 document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
}
.bg {
	background-color: #C2BEBF;
	width: 100%;
	height: 100%;
	left:0;
	top:0;/*FF IE7*/
	filter:alpha(opacity=40);/*IE*/
	opacity:0.4;/*FF*/
	z-index:1;
	position:fixed!important;/*FF IE7*/
	position:absolute;/*IE6*/
 _top:       expression(eval(document.compatMode &&  document.compatMode=='CSS1Compat') ?  documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
 document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
}
-->
</style>
<script language="javascript" type="text/javascript">
function showDiv(){
document.getElementById('popDiv').style.display='block';
document.getElementById('bg').style.display='block';
}

function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
}

</script>
<div id="popDiv" class="mydiv" style="display:none;">The system is dealing with your request, please waiting...<br/>
  <!--<a href="javascript:closeDiv()">close</a>-->
</div>
<div id="bg" class="bg" style="display:none;"></div>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹出半透明层 (支持IE FF)</title>
</head>
<body>
<form id="frm1" name="frm1" action="new_page_2.htm" method="post">
  <input type="button" value="Show DIV" onClick="showDiv()" />
  <select>
    <option >test</option>
  </select>
  <br>
  <br>
  <br>
  <br>
  <select name="selOccPool" multiple="multiple"  size="6"  style="width:20%"  id="selOccPool">
    <option value = "**All**" selected="true">**All**</option>
    <option value="6A">6A</option>
    <option value="6B">6B</option>
    <option value="6C">6C</option>
    <option value="6D">6D</option>
    <option value="6E">6E</option>
    <option value="6F">6F</option>
    <option value="6G">6G</option>
  </select>
</form>
</body>
</html>

 

你可能感兴趣的:(JavaScript,html,XHTML,css,IE)