<div class="codetitle"> <span><a style="CURSOR: pointer" data="82918" class="copybut" id="copybut82918" onclick="doCopy('code82918')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code82918"> <br><!--弹出层的显示与隐藏--> <br><script type="text/javascript"> <br>//弹出层的显示 <br>//overlays:为遮罩层的ID <br>//wins:弹出层窗体的ID <br>//弹出层中用于拖动的ID <br>function popDIV_show(overlays,wins,wins_title) { <br>var oLays = documentgetElementById(overlays); <br>var oWins = documentgetElementById(wins); <br>var oWins_title = documentgetElementById(wins_title); <br>var bDrag = false; <br>var disX = disY = 0; <br>var w = ""; <br>var n = 1; <br>if (n > 0) { <br>oLaysstyledisplay = "block"; <br>oWinsstyledisplay = "block"; <br>oWins_titleonmousedown = function(event) { <br>var event = event || windowevent; <br>bDrag = true; <br>disX = eventclientX - oWinsoffsetLeft; <br>disY = eventclientY - oWinsoffsetTop; <br>thissetCapture && thissetCapture(); <br>return false <br>}; <br>documentonmousemove = function(event) { <br>if (!bDrag) <br>return; <br>var event = event || windowevent; <br>var iL = eventclientX - disX; <br>var iT = eventclientY - disY; <br>var maxL = documentdocumentElementclientWidth <br>- oWinsoffsetWidth; <br>var maxT = documentdocumentElementclientHeight <br>- oWinsoffsetHeight; <br>iL = iL < 0 ? 0 : iL; <BR>iL = iL > maxL ? maxL : iL; <br>iT = iT < 0 ? 0 : iT; <BR>iT = iT > maxT ? maxT : iT; <br>oWinsstylemarginTop = oWinsstylemarginLeft = 0; <br>oWinsstyleleft = iL "px"; <br>oWinsstyletop = iT "px"; <br>return false; <br>}; <br>documentonmouseup = windowonblur = oWins_titleonlosecapture = function() { <br>bDrag = false; <br>oWins_titlereleaseCapture && oWins_titlereleaseCapture(); <br>}; <br>} <br>} <br>//弹出层的隐藏 <br>//overlays:为遮罩层的ID <br>//wins:弹出层窗体的ID <br>function popDIV_hidden(overlays,wins) { <br>var oWins = documentgetElementById(wins); <br>var oLays = documentgetElementById(overlays); <br>oWinsstyledisplay = "none"; <br>oLaysstyledisplay = "none"; <br>} <br></script> <br> </div>