아래와 같습니다. 코드를 복사합니다. 코드는 다음과 같습니다. <br> function alertWin(title, msg, w, h) { <br><br> var titleheight = "22px"; // 窗口标题高度 <br> var bordercolor = "#666699"; //窗口的边框颜色 <br> var titlecolor = "#FFFFFF"; // 窗口的标题颜色 <br> var titlebgcolor = "#666699"; // 窗口的标题背景色 <br> var bgcolor = "#FFFFFF"; // 内容背景色 <br> var iWidth = document.documentElement.clientWidth; //这个窗口的宽度 <br> var iHeight = document.documentElement.clientHeight; //这个窗口的高度 <br><br> //背景层的格式 <br> var bgObj = document.createElement("div"); <br><br> bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:" + iWidth + "px;height:" + Math.max(document.body.clientHeight, iHeight) + "px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:1000;"; <br><br> document.body.appendChild(bgObj); <br><br> var iframe2 = document.createElement("iframe"); <br> iframe2.style.cssText = "position:absolute; top:0px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000; z-index:1001; border-style:none; border-width:0px; border:0px;width:" + iWidth + "px;height:" + iHeight + "px"; <br> bgObj.appendChild(iframe2); <br><br> //创建一个弹出层 <br> var msgObj = document.createElement("div"); <br> //设置弹出的层的样式 <br> msgObj.style.cssText = "position:absolute;font:11px '宋体';top:" + (iHeight - h) / 2 + "px;left:" + (iWidth - w) / 2 + "px;width:" + w + "px;height:" + h + "px;text-align:center;border:1px solid " + bordercolor + ";background-color:" + bgcolor + ";padding:1px;line-height:22px;z-index:1001;"; <br> document.body.appendChild(msgObj); <br> //创建一个table用于容纳层上的内容 <br> var table = document.createElement("table"); <br> //将Table放到弹出层上 <br> msgObj.appendChild(table); <br> //设置table的格式 <br> table.style.cssText = "margin:0px;border:0px;padding:0px;"; <br> table.cellSpacing = 0; <br> //插入一行用于显示标题 <br> var tr = table.insertRow(-1); <br> //插入一个单元格用于容纳标题 <br> var titleBar = tr.insertCell(-1); <br> titleBar.style.cssText = "width:100%;height:" + titleheight + "px;text-align:left;padding:3px;margin:0px;font:bold 13px '宋体';color:" + titlecolor + ";border:1px solid " + bordercolor + ";cursor:move;background-color:" + titlebgcolor; <br> titleBar.style.paddingLeft = "10px"; <br> //设置标题 <br> titleBar.innerHTML = title; <br> //设置曾德拖动事件 <br> var moveX = 0; <br> var moveY = 0; <br> var moveTop = 0; <br> var moveLeft = 0; <br> var moveable = false; <br> var docMouseMoveEvent = document.onmousemove; <br> var docMouseUpEvent = document.onmouseup; <br> //鼠标点击标题 <br> titleBar.onmousedown = function() { <br> var evt = getEvent(); <br> 이동 가능 = true; <br> moveX = evt.clientX; <br> moveY = evt.clientY; <br> moveTop =parseInt(msgObj.style.top); <br> moveLeft =parseInt(msgObj.style.left); <br> //鼠标拖动 <br> document.onmousemove = function() { <br> if (이동 가능) { <br> var evt = getEvent(); <br> var x = moveLeft evt.clientX - moveX; <br> var y = moveTop evt.clientY - moveY; <br> if (x > 0 && (x w < iWidth) && y > 0 && (y h < iHeight)) { <BR> msgObj.style.left = x "px"; <BR> msgObj.style.top = y "px"; <BR> } <BR> } <BR> }; <BR> document.onmouseup = function() { <BR> if (이동 가능) { <BR> document.onmousemove = docMouseMoveEvent; <BR> document.onmouseup = docMouseUpEvent; <BR> 이동 가능 = false; <BR> moveX = 0; <BR> moveY = 0; <BR> moveTop = 0; <BR> moveLeft = 0; <BR> } <BR> }; <BR> } <br><br> //关闭按钮事件 <BR> var closeBtn = tr.insertCell(-1); <BR> closeBtn.style.cssText = "커서:포인터; 텍스트 정렬:오른쪽;패딩:2px;배경 색상:" titlebgcolor; <BR> closeBtn.innerHTML = "<span style='font-size:15pt;color:" titlecolor ";'>×</span>"; <br> closeBtn.onclick = function() { <br> document.body.removeChild(bgObj); <br> document.body.removeChild(msgObj); <br> }<br><br> // 팝업 메시지 창 내용 <br> var msgBox = table.insertRow(-1).insertCell(-1) "; <br> msgBox.colSpan = 2; 🎜> var nameLable = nameBox.insertCell(-1); <br> nameLable.innerHTML = "<br/>신원 인증서 번호 입력: <br/>" <br> var nametext = nameBox.insertCell(-1) ; <br> nametext.style.cssText = "글꼴:12pt '宋体';text-align:Left; 여백-왼쪽:0px"; <br> nametext.innerHTML = "<br/><input type= 'text' value='' id='modalName'/> <br/>"; <br> //레이어의 작업 버튼 콘텐츠 <br> var submitBox = table.insertRow(-1) ; <br> var submitBox.insertCell(-1); <br> submitBtn.style.cssText = "text-align: center;" <br> submitBtn.innerHTML = " <br/><input type='Button' value='OK' id='saveHeader'onclick='return GetCark ()' /><br/>"; <br> 함수 getEvent() { <br> <br>