JS 弹出对话框 (遮罩) 透明, 可拖动的简单实例
<html> <head> <script> ฟังก์ชั่น salert (txt) {// var esrc = (document.all)? window.event.srcelement: อาร์กิวเมนต์ [1]; var shield = document.createelement ("div"); shield.id = "shield.style.style.style.position = "0px"; shield.style.width = "100%"; // window.alert (document.body.scrollheight); shield.style.height = document.body.scrollheight+"px"; shield.style.style.background = "White"; "10,000"; shield.style.filter = "alpha (ความทึบ = 80)"; shield.style.Opacity = 0.8; // shield.style.border-width = หนา; strhtml = "<อินพุตประเภท =/" ปุ่ม/"ค่า =/" />/n"shield.innerhtml = strhtml; document.body.appendchild (Shield); this.dook = function () {document.body.removechild (Shield);} document.getElementById ("do_ok"). โฟกัส () value = 登陆> <p align = center> <elect> <petion> --- </optup> </select> </p> </body> </html> <html> <head> <script> var dragapproved = falsevar minrestore = 0 // 该变量表示窗口目前的状态, 0 表示初始化状态, 1 表示最大化状态 var initialWidth, initialHeight // 若ไคลเอ็นต์ ns6 = document.getElementById &&! document.allfunction iEcompattest () {return (! window.opera && document.compatmode && document.compatmode! = "backcompat")? document.documentElement: document.body} ฟังก์ชั่น drag_drop (e) {ถ้า (ie5 && dragapproved && event.button == 1) {document.getElementById ("dwindow"). style.left = tempx+event.clientx-offsetx+"px" document.getElementById ("dwindow") (ns6 && dragapproved) {document.getElementById ("dwindow"). style.left = tempx+e.clientx-oundsetx+"px" document.getElementById ("dwindow") style.top = tempy+e.clienty-offsety+"px"}} ฟังก์ชั่น Event.Clientx: E.Clientxoffsety = IE5? Event.Clienty: E.ClientyDocument.getElementById ("DWINDOWCONTENT"). style.display = "ไม่มี" // 此句代码可不要 tempx = parseInt (document.getElementById ("dwindow"). style.left) tempy = parseint (document.getElementById ("dwindow"). style.top) dragapproved = truedocument.getElementById ("dwindow") (! ie5 &&! ns6) // 若不为 ie 或 netscpae 浏览器, 则使用一般的 window.open 进行弹出窗口处理 //window.open(url,"","width=width,Height=Height,scrollbars = 1 ") {} else {document.getElementById (" dwindow "). style.display = ''; document.getElementById (" dwindow ") สไตล์ Width = InitialWidth = width+"px"; document.getElementById ("dwindow"). style.height = initialHeight = ความสูง+"px"; document.getElementById ("dwindow") style.left = "300px"; window.pageyoffset*1+30+"px": iEcompattest (). scrolltop*1+30+"px"; // document.getElementById ("cframe"). src = url}} ฟังก์ชั่นสูงสุด () WindowDocument.getElementById ("MaxName") SetAttribute ("SRC", "layout.png") document.getElementById ("dwindow"). style.width = ns6? window.innerWidth-20+"px": iEcompattest (). clientWidth+"px" document.getElementById ("dwindow"). style.height = ns6? window.innerHeight-20+"px": iEcompattest (). clientheight+"px"} else {minRestore = 0 // คืนค่า WindowDocument.getElementById ("MaxName") SetAttribute ("SRC", "layout.png") document.getElementById ("dwindow"). style.width = initialWidthDocument.getElementIid ("dwindow") window.pagexoffset+"px": iEcompattest (). scrollleft+"px" document.getElementById ("dwindow"). style.top = ns6? window.pageyoffset+"px": iEcompattest (). scrolltop+"px"} function closit () {document.getElementById ("dwindow"). style.display = "ไม่มี"} ฟังก์ชั่น stopDrag () {dragApproved = false; document.getElementById ("dwindow"). Onmousemove = null; document.getElementById ("dwindowContent"). style.display = "" // extra} </script> </head> style = "ตำแหน่ง: Absolute; พื้นหลังสี: #EBEBEB; CURSOR: Hand; ซ้าย: 0PX; TOP: 0PX; แสดง: ไม่มี" onMousedOwn = "InitializedRag (เหตุการณ์)" onMouseUp = "stopDrag ()" onSelectStart = "return false"> id = "maxName" onclick = "myxime ()"> <img src = "icon_delete.gif" onclick = "closeit ()"> </div> <div id = "dwindowContent" style = "ความสูง: 100%"> </div> onclick = 'loadwindow (300,200);'> </body> </html>以上这篇 js 弹出对话框 (遮罩) 透明, 可拖动的简单实例就是小编分享给大家的全部内容了, 希望能给大家一个参考, 也希望大家多多支持武林网。也希望大家多多支持武林网。