<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><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <BR><html xmlns="http://www.w3.org/1999/xhtml"> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>简易弹出框</title> <br><style type="text/css"> <br>.mydiv { <br>背景色: #ff6; <br>ボーダー: 5px ソリッド #f90; <br>text-align: 中央; <br>行の高さ: 40px; <br>フォントサイズ: 12px; <br>フォントの太さ: 太字; <br>z-インデックス:99; <br>幅: 300ピクセル; <br>高さ: 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>背景色: #ccc; <br>幅: 100%; <br>高さ: 100%; <br>左: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>/*終了*/ <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></head> <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></body> <br></html> <br>