SoFunction
Updated on 2025-02-28

A DIV written in JavaScript pops up a web page dialog box


function MessageBox()
{
= "21"; // Prompt window title height
= "#666699"; // The border color of the prompt window
= "#1259a4"; // Title color of the prompt window
= "#e4f1fb"; // Title background color of the prompt window
= "#FFFFFF"; // The background color of the prompt content
="left";

=function(title, msg, framesrc, w, h)
{
var iWidth = ;
var iHeight = +*2;
var bgObj = ("div");
= "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+(, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;";
(bgObj);

var msgObj=("div");
= "position:absolute;font:11px 'install';top:"+(iHeight-h)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "++";background-color:"++";padding:1px;line-height:22px;z-index:102;";
(msgObj);

var table = ("table");
(table);
= "margin:0px;border:0px;padding:0px;";
= 0;
var tr = (-1);
var titleBar = (-1);
= ";width:"+(w-84)+"px;height:"++"px;text-align:left;padding:3px;margin:0px;font:bold 13px 'install';color:"++";cursor:move;background-color:" + ;
= "10px";
= title;
var moveX = 0;
var moveY = 0;
var moveTop = 0;
var moveLeft = 0;
var moveable = false;
var docMouseMoveEvent = ;
var docMouseUpEvent = ;

= function(){
var evt = getEvent();
moveable = true;
moveX = ;
moveY = ;
moveTop = parseInt();
moveLeft = parseInt();

= function(){
if (moveable)
{
var evt = getEvent();
var x = moveLeft + - moveX;
var y = moveTop + - moveY;
if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) )
{
= x + "px";
= y + "px";
}
}
};

= function (){
if (moveable)
{
= docMouseMoveEvent;
= docMouseUpEvent;
moveable = false;
moveX = 0;
moveY = 0;
moveTop = 0;
moveLeft = 0;
}
};
}

var closeBtn = (-1);
= "cursor:pointer; padding:2px;background-color:" + ;
= "<span style="font-size:10pt;color:"++";" style="font-size:10pt;color:"++";" id='closeBtn'>×Close window";
= function(){
(bgObj);
(msgObj);
}
var msgBox = (-1).insertCell(-1);
= "font:10pt 'install';";
= 2;

if(framesrc != "")
{
msg = "<iframe name='frmAlertWin' id='frmAlertWin' src="about:blank" src="about:blank" frameborder=0 marginwidth=0 marginheight=0 style='height:"+(-10)+"px;width:100%;'></iframe>";
}
= "<div style="\" style="\""text-align:"++";\">"+msg+"</div>";

if(("frmAlertWin") != null)
{
("frmAlertWin").src = framesrc;
}


function getEvent(){
return || [0];
}
}
}