js 弹出对话框 (弹出对话框) 透明, 可拖动的简单实例
<html> <head> <cript> 함수 salert (txt) {// var esrc = (document.all) Window.event.srcelement : arguments [1]; var shield = document.createElement ( "div"); Shield = "Shield"; Shield.style.position = "Absolute"; Shield.left = "0px"; "0px"; shield.style.width = "100%"; // wind = "alpha (opacity = 80)"; shield.style.opacity = 0.8; // shield.style.border-width = dick; strhtml = "<input type =/"button/"value =/"确 定 定/"id =/"do_ok/"onclick =/"dook ()/"/>/n"; hield.innerhtml = strhtml; document.body.appendChild (Shield); this.dook = function () {document.body.removeChild (Shield);} document.getElementById ( "do_ok"). focus ();} </head> <body> <input type = inclick = "salert ( '登陆成功!') align = center> <select> <옵션> --- </옵션> </select> </p> </body> </html> <html> <head> <cript> var dragenproved = falsevar minrestore = 0 // 该变量表示窗口目前的状态 该变量表示窗口目前的状态 该变量表示窗口目前的状态, 0 表示初始化状态 表示初始化状态, 1 var var initialwidth, initialheight // 若 client 浏览器为 ie5.0 以上版本的 var ide5 = document.all && document.getElementByid // 浏览器为 浏览器为 浏览器为 netscape6。0 var ns6 = var ns6 = getLement.alt.altefin iecompattest () {return (! window.opera && dut document.documentElement : document.body} 함수 drag_drop (e) {if (ie5 && dragenproved && event.button == 1) {document.getElementById ( "dwindow"). Style.left = tempx+event.clientx-portpetsx+"px"document.getElementById ( "dwindow") .top = tempy+event.clienty-offsety+"px"else (ns6 && dragenproved) {document.getElementById ( "dwindow"). Style.left = tempx+e.clientx-offsetx+"px"document.getElementById ( "dwindow"). style.top = tempy+e.Clienty-Orgeporty+"px"} {e) {offssetx = ie5? 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) dragpencroved = truedocument.getElementByid ( "dwindow"). onMouseMove = drag_drop} 함수 loadwindow (width,) {if (! ie5 &&! ns6) // : 若不为 ee 若不为 netscpae 浏览器 浏览器, 则使用一般的 wind = 1 ") {} else {docut width = initialWidth = width+"px"; document.getElementById ( "dwindow"). style.height = initialHeight = height+"px"; docut window.pageyoffset*1+30+"px": iecompattest (). scrolltop*1+30+"px"; // document.getElementByid ( "cframe"). src = url}} 함수 maximize () {if (minrestore == 0) {minrestore = 1 // maximize 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.getElementById ( "dwindow"). style.height = initialHeight} document.get6. window.pagexoffset+"px": iecompattest (). scrollleft+"px"document.getElementById ( "dwindow"). style.top = ns6? wind stopdrag () {dragencroved = false; document.getElementById ( "dwindow"). onMousEmove = null; document.getElementById ( "dwindowContent"). Style.display = ""// extra} </script> </head> <body> <div id = "dwindow" 스타일 = "위치 : #EBEBEB; 커서 : 핸드; 왼쪽; 왼쪽 : 0px; 상단 : 0px; 디스플레이 : NoneMousEdown ="초기화 (이벤트) "onMouseUp ="stopDrag () "onselectStart ="return "> <div align ="right "style ="back id = "maxname"onclick = "maximize ()"> <img src = "icon_delete.gif"onclick = "close ()"> </div> <div id = "dwindowContent"style = "height : 100%"> </div> </div> <input type = "value ="vallage = "弹出窗口 弹出窗口" onclick = '로드 윈도 (300,200);'> </body> </html>以上这篇 js 弹出对话框 (遮罩 遮罩) 透明, 可拖动的简单实例就是小编分享给大家的全部内容了 可拖动的简单实例就是小编分享给大家的全部内容了, 希望能给大家一个参考, 也希望大家多多支持武林网。 也希望大家多多支持武林网。