<div class="codetitle"> <span><a style="CURSOR: pointer" data="99847" class="copybut" id="copybut99847" onclick="doCopy('code99847')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code99847"> <br>// JavaScript Document <br>var dv; <br>var dvMsg; <br>関数customalert() <br>{ <br><br>dvMsg = document.createElement("div"); <br>dvMsg.style.position = "絶対"; <br>dvMsg.setAttribute('id', 'msg'); <br>dvMsg.style.width = "600px"; <br>dvMsg.style.padding = "10 0 2 0"; <br>dvMsg.style.height = "313px"; <br>dvMsg.style.background = "#EF621D"; <br>dvMsg.style.border = "1px ソリッド #6699dd"; <br>dvMsg.style.zIndex = "1112"; <br>document.body.appendChild(dvMsg); <br>document.getElementById("msg").style.top = document.documentElement.scrollTop (document.documentElement.clientHeight - document.getElementById("msg").offsetHeight)/2 "px"; <br>document.getElementById("msg").style.left = document.documentElement.scrollLeft (document.documentElement.clientWidth - document.getElementById("msg").offsetWidth)/2 "px"; <br>var imgs = document.createElement("div"); <br>imgs.setAttribute("id", "pic"); <br>imgs.title = "閉じる"; <br>imgs.style.float = "左"; <br>imgs.style.height = "20px"; <br>imgs.innerHTML = "<a href="http://www.jb51.net" target="_blank"><img src="../javascript/close.gif"/>< ;/a>"; <BR>imgs.style.color = "#FFF"; <BR>imgs.style.textAlign = "右"; <BR>imgs.style.cursor = "ポインター"; <BR>imgs.style.zIndex = "1114"; <BR>imgs.onclick = function() <BR>{ <BR>document.body.removeChild(dvMsg); <BR>document.body.removeChild(dv); <BR>} <br><br>document.getElementById("msg").appendChild(imgs); <BR>var divstr = document.createElement("div"); <BR>divstr.setAttribute("id", "info"); <BR>divstr.style.left = "0"; <BR>divstr.style.position = "絶対"; <BR>divstr.style.marginTop = "10px"; <BR>divstr.style.zIndex = "1115"; <BR>divstr.innerHTML = "<embed src="gallery/header2.swf" pluginspage="http://www.macromedia.com/shockwave/download /" width="600" height="313"> </embed>"; <br>document.getElementById("msg").appendChild(divstr); <br>} <br><br>functionscrolldivs() <br>{ <br>document.getElementById("msg").style.top=document.documentElement.scrollTop (document.documentElement.clientHeight-document.getElementById( "msg").offsetHeight)/2 "px"; <br>document.getElementById("msg").style.left=document.documentElement.scrollLeft (document.documentElement.clientWidth-document.getElementById("msg").offsetWidth)/2 "px"; <br>} <br><br>window.attachEvent("onresize",scrolldivs); <br>window.onscroll=scrolldivs; <br>window.onload=scrolldivs;<br> </div>