<div class="codetitle"> <span><a style="CURSOR: pointer" data="1317" class="copybut" id="copybut1317" onclick="doCopy('code1317')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code1317"> <br><!--内容层--> <br><div id="ShopConfirmLayer" style="position:absolute;top:300px;left:100px;z-index:900;border:1px red solid;width:500px;display:none;"> <br><input name="button1" value="关闭" type="button" onclick="CloseShopConfirm()"> <br> </div> <br><!--覆盖层--> <br><div id="webBgLayer" style="position:absolute;top:0px;left:0px;z-index:899;background-color:#ccc;height:100%;width:100%;display:none;-moz-opacity:0.5;filter:alpha(opacity=50);"></div> <br><script type="text/javascript"> <BR>function ShopConfirm(str){ <BR>var ShopConfirmLayer=document.getElementById("ShopConfirmLayer"); <BR>var webBgLayer=document.getElementById("webBgLayer"); <BR>ShopConfirmLayer.innerHTML=str; <BR>ShopConfirmLayer.style.display=""; <BR>ShopConfirmLayer.style.left=parseInt((document.documentElement.scrollWidth-ShopConfirmLayer.offsetWidth)/2)+document.documentElement.scrollLeft+"px"; <BR>ShopConfirmLayer.style.top=Math.abs(parseInt((document.documentElement.clientHeight-ShopConfirmLayer.offsetHeight)/2))+document.documentElement.scrollTop+"px"; <BR>webBgLayer.style.display=""; <BR>webBgLayer.style.height=document.documentElement.scrollHeight+"px"; <BR>} <BR>function CloseShopConfirm(){ <BR>var ShopConfirmLayer=document.getElementById("ShopConfirmLayer"); <BR>var webBgLayer=document.getElementById("webBgLayer"); <BR>ShopConfirmLayer.style.display="none"; <BR>webBgLayer.style.display="none"; <BR>} <BR></script> <br> </div> <br>注意上面的代码头部DTD应该是这样: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="79291" class="copybut" id="copybut79291" onclick="doCopy('code79291')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code79291"> <br> <br> <br> </div> <br><div class="htmlarea"> <textarea id="runcode9603"> <title>Untitled</title> fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf <input name="button2" onclick="ShopConfirm('fdsaf')" value="点我" type="button"> fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf <input name="button" onclick="ShopConfirm('fdsaf')" value="点我" type="button"> <!--内容层--> <div id="ShopConfirmLayer" style="position:absolute;top:300px;left:100px;z-index:900;border:1px red solid;width:500px;display:none;"> fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf fdasfsdfadf <input name="button1" value="关闭" type="button" onclick="CloseShopConfirm()"> </div> <!--覆盖层--> <div id="webBgLayer" style="position:absolute;top:0px;left:0px;z-index:899;background-color:#ccc;height:100%;width:100%;display:none;-moz-opacity:0.5;filter:alpha(opacity=50);"></div> <script type="text/javascript"> function ShopConfirm(str){ var ShopConfirmLayer=document.getElementById("ShopConfirmLayer"); var webBgLayer=document.getElementById("webBgLayer"); // ShopConfirmLayer.innerHTML=str; ShopConfirmLayer.style.display=""; ShopConfirmLayer.style.left=parseInt((document.documentElement.scrollWidth-ShopConfirmLayer.offsetWidth)/2)+document.documentElement.scrollLeft+"px"; ShopConfirmLayer.style.top=Math.abs(parseInt((document.documentElement.clientHeight-ShopConfirmLayer.offsetHeight)/2))+document.documentElement.scrollTop+"px"; webBgLayer.style.display=""; webBgLayer.style.height=document.documentElement.scrollHeight+"px"; } function CloseShopConfirm(){ var ShopConfirmLayer=document.getElementById("ShopConfirmLayer"); var webBgLayer=document.getElementById("webBgLayer"); ShopConfirmLayer.style.display="none"; webBgLayer.style.display="none"; } </script> </textarea><br><input onclick="runEx('runcode9603')" type="button" value="运行代码"> <input onclick="doCopy('runcode9603')" type="button" value="复制代码"> <input onclick="doSave(runcode9603)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>