JS 弹出对话框 (遮罩) 透明, 可拖动的简单实例
<html> <head> <cript> função salert (txt) {// var esrc = (document.all)? window.event.srcelement: argumentos [1]; var shield = document.createElement ("div"); shield.id = "Shield"; "0px"; shield.style.width = "100%"; // window.alert (document.body.scrolHeight); shield.style.height = document.body.scrolHeight+"px"; shield.style.back.background = "white"; shield.style.tectalign = "Centro"; "10000"; shield.style.filter = "alpha (opacidade = 80)"; shield.style.Opacity = 0,8; // shield.style.border-width = espess; />/n";shield.innerhtml = strhtml; document.body.appendChild (shield); this.dook = function () {document.body.removechild (shield);} document.getElementById ("do_ok"). Valor = 登陆> <P align = Center> <select> <pption> --- </pption> </leclect> </p> </body> </html> <html> <head> <cript> var dragApproved = falseVar minrestore = 0 // 该变量表示窗口目前的状态 , 0 表示初始化状态 , 1 表示最大化状态 var inicialWidth, InitialHeight // 若 Client 浏览器为 ie5.0 以上版本的 var ie5 = document.all &&getElementById // 若 cliente 浏览器为 NetsCape6 。0sCape6 = Document.all && iecompattest () {return (! window.opera && document.compatmode && document.compatmode! = "backcompat")? document.documentElement: document.body} função drag_drop (e) {se (ie5 && dragApproved && event.button == 1) {document.getElementById ("dwindow"). style.left = tempx+event.clientx-offsetx+"px" document.getElementById ("DWIDOW"). style.top = tempy+event.clienty-offsety (ns6 && dragApproved) {document.getElementById ("dwindow"). style.left = tempx+e.clientx-offsetx+"px" document.getElementById ("dwindow"). styleized.top = tempy+e.clienty-offset+"Px"}} função Event.ClientX: E.ClientXoffSety = IE5? Event.Clienty: e.clientydocument.getElementById ("DwindowContent"). style.display = "None" // 此句代码可不要 tempx = parseInt (document.getElementById ("dwindow"). Style.left) tempy = parseInt (document.getElementById ("dwindow"). Style.top) dragApproved = dragTocument.getElementByid ("dWindOwwow) (! ie5 &&! ns6) // 若不为 ie 或 NetScpae 浏览器 , 则使用一般的 Window.open 进行弹出窗口处理 //window.open(url,"","width=width.Height=Height.ScrollBars = 1 ") {} else {document.getElementById (" dwindow "). Style.display = ''; document.getElementById (" dwindow "). Style. largura = inicialwidth = width+"px"; document.getElementById ("dwindow"). style.height = inicialHeight = altura+"px"; document.getElementById ("dwindow"). style.left = "300px"; window.pageyoffset*1+30+"px": iecompattest (). scrolltop*1+30+"px"; // document.getElementById ("cframe"). src = url}} função windowdocument.getElementById ("maxname"). setAttribute ("src", "layout.png") document.getElementById ("dwindow"). style.width = ns6? window.innerWidth-20+"px": iCompattest (). ClientWidth+"px" document.getElementById ("dwindow"). style.height = ns6? window.innerHeight-20+"px": iCompattest (). ClientHeight+"px"} else {MinRestore = 0 // Restaurar windowdocument.getElementById ("maxname"). SetAttribute ("src", "layout.png") document.getElementById ("dwindow"). style.width = initialWidthDocument.getElementById ("dwindow". window.pagexoffset+"px": iecompattest (). scrollleft+"px" document.getElementById ("dwindow"). style.top = ns6? window.Pageyoffset+"px": iecompattest (). scrolltop+"px"} função closeit () {document.getElementById ("dwindow"). style.display = "nenhum" função} função stopDrag () {dragApproved = false; document.getElementById ("dwindow"). onmouseMove = null; document.getElementById ("DwindowContent"). style.display = "" "// extra} </script> </head> <body> <d id =" Dw sudow " style = "Posição: Absoluto; cor de fundo: #EBeBeB; Cursor: Hand; esquerda: 0px; topo: 0px; Display: Nenhum" OnMousedown = "InitializedRag (Event)" OnMouseUp = "StopDrag ()" OnSelectStart = "Return"> <div alinh = "right" "Style =" BorderColor: " id = "maxname" onclick = "maximize ()"> <img src = "icon_delete.gif" onclick = "closeit ()"> </div> <div id = "dwindowcontent" style = "altura: 100%"> </div> </div> <input type = "botão" "" "" "" "" "" OnClick = 'LoadWindow (300.200);'> </body> </html>以上这篇 JS 弹出对话框 (遮罩) 透明, 可拖动的简单实例就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。