<div class="codetitle"> <span><a style="CURSOR: pointer" data="22768" class="copybut" id="copybut22768" onclick="doCopy('code22768')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code22768"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>简易弹出框</title> <br><style type="text/css"> <BR>.mydiv { <BR>background-color: #ff6; <BR>border: 5px solid #f90; <BR>text-align: center; <BR>line-height: 40px; <BR>font-size: 12px; <BR>font-weight: bold; <BR>z-index:99; <BR>width: 300px; <BR>height: 120px; <BR>left:50%;/*FF IE7*/ <BR>top: 50%;/*FF IE7*/ <br><br>margin-left:-150px!important;/*FF IE7 */ <BR>margin-top:-60px!important;/*FF IE7 */ <br><br>margin-top:0px; <br><br>position:fixed!important;/*FF IE7*/ <BR>position:absolute;/*IE6*/ <br><br>_top: expression(eval(document.compatMode && <BR>document.compatMode=='CSS1Compat') ? <BR>documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/ <BR>document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/ <br><br>} <br><br>.bg { <BR>background-color: #ccc; <BR>width: 100%; <BR>height: 100%; <BR>left:0; <BR>top:0;/*FF IE7*/ <BR>filter:alpha(opacity=10);/*IE*/ <BR>opacity:0.8;/*FF*/ <BR>z-index:1; <BR>position:fixed!important;/*FF IE7*/ <BR>position:absolute;/*IE6*/ <br><br>_top: expression(eval(document.compatMode && <BR>document.compatMode=='CSS1Compat') ? <BR>documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/ <BR>document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/ <br><br>} <BR>/*The END*/ <br><br></style> <br><script type="text/javascript"> <BR>function showDiv(){ <BR>document.getElementById('popDiv').style.display='block'; <BR>document.getElementById('bg').style.display='block'; <BR>} <br><br>function closeDiv(){ <BR>document.getElementById('popDiv').style.display='none'; <BR>document.getElementById('bg').style.display='none'; <BR>} <br><br></script> <br><br> <br><br> <br><br><div id="popDiv" class="mydiv" style="display:none;"> <br>弹框内容<br> <br><a href="javascript:closeDiv()">关闭</a> </div> <br><div id="bg" class="bg" style="display:none;"></div> <br><br><div style="padding-top: 20px;"> <br><input type="Submit" name="" value="点此弹框" onclick="javascript:showDiv()"> <br> </div> <br> <br> <br> </div>