JS 弹出对话框 (遮罩) 透明, 可拖动的简单实例
<html> <Head> <Script> Funktion salert (txt) {// var esrc = (document.All)? window.event.srcelement: arguments [1]; var shield = document.createelement ("div"); Shield.id.Id = "Shield.Style.Style.Style.Style. "0px"; Shield.Style.width = "100%"; // window.alert (document.body.scrollHeight); Shield.Style.Height = document.body.ScrollHeight+"px"; Shield.style.background = "White"; Shield.style.textalign = "Center"; "10000"; Shield.Style.Filter = "Alpha (Opazität = 80)"; Shield.Style.Opacity = 0,8; // Shield.Style.border-Width = dick; strhtml = "<Eingabe type =/" button/"value =/" />/n";schield.innerHtml = strhtml; document.body.AppendChild (Shield); this.dook = function () {document.body.removeChild (Shield);} document.getElementById ("do_ok"). Focus (); value = 登陆> <p align = center> <auswahl> <option> --- </option> </select> </p> </body> </html> <html> <Head> <Script> var Drag -angemeldet = falsevar minrestore = 0 // 该变量表示窗口目前的状态 , 0 表示初始化状态 , 1 表示最大化状态 var initialwidth, initialHeight // 若 client 浏览器为 ie5.0 以上版本的 var ie5 = document.All && document.getElementById // 若 client 浏览器为 netscape6。0 版本以上的 var ns6 = document. iecompatest () {return (! window.opera && document.compatmode && document.comPatmode! = "BackCompat")? document.documentElement: document.body} function drag_drop (e) {if (IE5 && DragaVroved && event.button == 1) {document.getElementById ("schwindow") (NS6 && Drag Areduved) {document.getElementById ("twindow"). event.clientX: e.clientXoffsety = IE5? event.clienty: e.clientydocument.getElementById ("twindowcontent"). // 此句代码可不要 tempx = parseInt (document.getElementById ("twindow"). Style.left) tempy = parseInt (document.getElementById ("twindow"). Top) Draganuproved = truedocument (! IE5 &&! ns6) // 若不为 dh 或 netcpae 浏览器 , 则使用一般的 window.open 进行弹出窗口处理 //window.open(url,""," = 1 ") {} else {document.getElementById (" schwindow "). Style.display = ''; document.getElementById (" schwindow "). width = initialwidth = width+"px"; document.getElementById ("schwindow"). window.pageyOffset*1+30+"px": iecompatest (). scrolltop*1+30+"px"; // document.getElementById ("cframe"). windowDocument.getElementById ("maxname"). setAttribute ("src", "layout.png") document.getElementById ("twindow"). style.width = ns6? window.innnerwidth-20+"px": iecompatest (). clientwidth+"px" document.getElementById ("schwindend"). style.height = ns6? window.innerHeight-20+"px": iecompatest (). clientHeight+"px"} else {minrestore = 0 // wiederherstellen windowDocument.getElementById ("maxname"). setAttribute ("src", "layout.png") document.getElementById ("twindow"). style.width = in itialWidthdocument window.pagexOffset+"px": iecompatest (). scrollleft+"px" document.getElementById ("schwindend"). style.top = ns6? window.pageyOffset+"px": iecompatest (). scrolltop+"px"} function closeit () {document.getElementById ("twindow"). style.display = "none"} Funktion stopdrag () {DragabVreduted = false; document.getElementById ("twindow"). onmousemove = null; document.getElementById ("twindowContent"). style = "Position: absolut; Hintergrundfarbe: #ebebeb; Cursor: Hand; links: 0px; top: 0px; Anzeige: Keine" OnmouseDown = "InitializedGrag (Ereignis)" onmouseUp = "stopdrag ()" onSelectstart = "return"> <div align = "right" stil. id = "maxname" onclick = "maximize ()"> <img src = "icon_delete.gif" Onclick = "Closeit ()"> </div> <div id = "dwindowContent" style = "High: 100%"> </div> </div> <Eingabe type = "button" value "弹出窗口" 弹出窗口 "弹出窗口" 弹出窗口 "弹出窗口" onclick = 'lastWindow (300.200);'> </body> </html>以上这篇 js 弹出对话框 (遮罩) 透明, 可拖动的简单实例就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。 也希望大家多多支持武林网。 也希望大家多多支持武林网。 也希望大家多多支持武林网。 也希望大家多多支持武林网。 也希望大家多多支持武林网。 透明 透明 透明)