<br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode2'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode2"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>无标题文档</title> <br><style type="text/css"> <br />/*弹出层的STYLE*/ <br />html,body {height:100%; margin:0px; font-size:12px;} <br />.mydiv { <br />background-color: #ff6; <br />border: 1px 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 />margin-left:-150px!important;/*FF IE7 该值为本身宽的一半 */ <br />margin-top:-60px!important;/*FF IE7 该值为本身高的一半*/ <br />margin-top:0px; <br />position:fixed!important;/*FF IE7*/ <br />position:absolute;/*IE6*/ <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 />.bg { <br />background-color: #ccc; <br />width: 100%; <br />height: 100%; <br />left:0; <br />top:0;/*FF IE7*/ <br />filter:alpha(opacity=50);/*IE*/ <br />opacity:0.5;/*FF*/ <br />z-index:1; <br />position:fixed!important;/*FF IE7*/ <br />position:absolute;/*IE6*/ <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 />/*The END*/ <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 />function closeDiv(){ <br />document.getElementById('popDiv').style.display='none'; <br />document.getElementById('bg').style.display='none'; <br />} <br /></script> <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><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><div style="padding-top: 20px;"> <br><input type="Submit" name="" value="显示层" onclick="javascript:showDiv()"> <br> </div> <br> <br> <br> </div> <br>附加一个好看的样式 <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode3'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode3"> <br> <br><title></title> <br><style> <br />.mesWindowTop { <br />font-size: 12px; <br />font-weight: bold; <br />text-align: left; <br />} <br />.mesWindowContent { <br />font-size: 12px; <br />} <br />.mesWindow { <br />background: none repeat scroll 0 0 #FFFFFF; <br />border: 1px solid #666666; <br />} <br /></style> <br> <br> <br><div id="mesWindow" class="mesWindow" style="top: 180px; position: absolute; width: 600px; margin-left: -300px; left: 50%; z-index: 9999;"> <div class="mesWindowTop"><table width="100%" height="100%"><tbody><tr> <td>窗口标题</td> <td style="width:1px;"><input type="button" value="关闭" class="close" title="关闭窗口" onclick="closeWindow();"></td> </tr></tbody></table></div> <div id="mesWindowContent" class="mesWindowContent"><div style="padding:20px 0 20px 0;text-align:center">消息正文</div></div> <div class="mesWindowBottom"></div> </div> <br> <br> <br> </div>