| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- function alertWin(title, w, h,content){
- var titleheight = "32px"; // 提示窗口标题高度
- var bordercolor = "#0F6ADC"; // 提示窗口的边框颜色
- var titlecolor = "#FFFFFF"; // 提示窗口的标题颜色
- var titlebgcolor = "#0F6ADC"; // 提示窗口的标题背景色
- var bgcolor = "#FFFFFF"; // 提示内容的背景色
- var iWidth = document.documentElement.clientWidth;
- var iHeight = document.documentElement.clientHeight;
- var msgObj=document.createElement("div");
- 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:2px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:102;";
- document.body.appendChild(msgObj);
-
- var titleBar = document.createElement("div");
- msgObj.appendChild(titleBar);
- titleBar.style.cssText = "width:100%;height:32px;text-align:left;margin:0px;font:bold 13px '宋体';color:"+titlecolor+";border:1px solid " + bordercolor + ";cursor:move;background-color:" + titlebgcolor; titleBar.innerHTML = title;
- var moveX = 0;
- var moveY = 0;
- var moveTop = 0;
- var moveLeft = 0;
- var moveable = false;
- var docMouseMoveEvent = document.onmousemove;
- var docMouseUpEvent = document.onmouseup;
- titleBar.onmousedown = function() {
- var evt = getEvent();
- moveable = true;
- moveX = evt.clientX;
- moveY = evt.clientY;
- moveTop = parseInt(msgObj.style.top);
- moveLeft = parseInt(msgObj.style.left);
-
- document.onmousemove = function() {
- if (moveable) {
- var evt = getEvent();
- var x = moveLeft + evt.clientX - moveX;
- var y = moveTop + evt.clientY - moveY;
- if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) {
- msgObj.style.left = x + "px";
- msgObj.style.top = y + "px";
- }
- }
- };
- document.onmouseup = function () {
- if (moveable) {
- document.onmousemove = docMouseMoveEvent;
- document.onmouseup = docMouseUpEvent;
- moveable = false;
- moveX = 0;
- moveY = 0;
- moveTop = 0;
- moveLeft = 0;
- }
- };
- }
-
- var closeBtn =document.createElement("div");
- closeBtn.style.cssText = "position:absolute;top:1px;right:1px;height:22px;cursor:pointer; padding:2px;background-color:"+titlebgcolor;
- closeBtn.innerHTML = "<span style='font-size:12pt; color:"+titlecolor+";'>×</span>";
- closeBtn.onclick = function(){
- document.body.removeChild(msgObj);
- }
- msgObj.appendChild(closeBtn);
- content.style.cssText="text-align:left;OVERFLOW: auto; HEIGHT: 210px";
-
- msgObj.appendChild(content);
- var btn = document.createElement("div");
- btn.innerHTML="<input type='button' name='save' value='确定' onclick='selectKey()'>";
- msgObj.appendChild(btn);
- var footBar = document.createElement("div");
- msgObj.appendChild(footBar);
- footBar.style.cssText = "position:absolute;bottom:0px;right:0px;width:100%;height:22px;text-align:left;margin:0px;font:bold 13px '宋体';color:"+titlecolor+";border:1px solid " + bordercolor + ";cursor:move;background-color:" + titlebgcolor; footBar.innerHTML = "F1JEE";
-
-
- // 获得事件Event对象,用于兼容IE和FireFox
- function getEvent() {
- return window.event || arguments.callee.caller.arguments[0];
- }
- }
- function confirmDlg(){
- }
- function msgDlg(){
- }
-
|