<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> MSN pop-up message box </title>
<Script language = "JavaScript" type = "text/JavaScript">
Function messshow (ID, width, height, caption, title, message, target, Action)
{
This. ID = ID;
This. Title = title;
This. Caption = Caption;
This. Message = message;
This.tar get = target;
This. Action = action;
This. width = width? Width: 250;
This. Height = height? Height: 150;
This. Timeout = 250; // message stay time
This. speed = 10; // message speed, the smaller the speed, the faster
This. Step = 2; // move the step size
This. Right = screen. Width-1;
This. Bottom = screen. height;
This. Left = this. Right-This. width;
This. Top = This. Bottom-This. height;
This. Timer = 0;
This. Pause = false;
This. Close = false;
This. autohide = true;
}
Messshow. Prototype. Hide = function ()
{
If (this. onUnload ())
{
VaR offset = This. Height> This. bottom-this.top? This. Height: This. bottom-this.top;
VaR me = this;
If (this. Timer> 0)
{
Window. clearinterval (Me. Timer );
}
VaR fun = function ()
{
If (Me. Pause = false | me. Close)
{
VaR x = me. Left;
Var y = 0;
VaR width = me. width;
VaR Height = 0;
If (Me. Offset> 0 ){
Height = me. offset;
}
Y = me. Bottom-height;
If (Y> = me. Bottom ){
Window. clearinterval (Me. Timer );
Me. Pop. Hide ();
} Else {
Me. offset = me. offset-Me. step;
}
Me. Pop. Show (X, Y, width, height );
}
}
This. Timer = Window. setinterval (fun, this. Speed)
}
}
// Message unload event, which can be rewritten
Messshow. Prototype. onUnload = function ()
{
Return true;
}
// Message command event. to implement your own connection, rewrite it.
Messshow. Prototype. oncommand = function ()
{
Publish publish open(this.action,this.tar get );
This. Hide ();
}
// Message Display Method
Messshow. Prototype. Show = function ()
{
VaR opopup = Window. createpopup (); // ie5.5 +
This. Pop = opopup;
VaR W = This. width;
VaR H = This. height;
VaR STR = "<Div style = 'border-Right: # 005fee 1px solid; border-top: # 005fee 1px solid; Z-INDEX: 99999; left: 0px; border-left: # 005fee 1px solid; width: "+ W +" PX; border-bottom: # 005fee 1px solid; position: absolute; top: 0px; Height: "+ H +" PX; background-color: # ffffff '>"
STR + = "<Table Style = 'border-top: # ffffff 1px solid; border-left: # ffffff 1px solid 'cellspacing = 0 cellpadding = 0 width = '000000' bgcolor = # ffffff border = 0>"
STR + = "<tr>"
STR + = "<TD style = 'font-size: 12px; color: # 0052cc 'width = 30 Height = 24> trim </TD>"
STR + = "<TD style = 'padding-left: 4px; font-weight: normal; font-size: 12px; color: # 0052cc; padding-top: 4px 'valign = middle width = '000000'> "+ this. caption + "</TD>"
STR + = "<TD style = 'padding-Right: 2px; padding-top: 2px 'valign = middle align = right width = 19>"
STR + = "<span Title = close style = 'font-weight: bold; font-size: 12px; cursor: hand; color: red; margin-right: 4px 'id = 'btsysclose'> × </span> </TD>"
STR + = "</tr>"
STR + = "<tr>"
STR + = "<TD style = 'padding-Right: 1px; padding-bottom: 1px 'colspan = 3 Height =" + (h-28) + ">"
STR + = "<Div style = 'border-Right: ffffff 1px solid; padding-Right: 8px; border-top: # 66a3ff 1px solid; padding-left: 8px; font-size: 12px; padding-bottom: 8px; border-left: # ffffff 1px solid; width: 100%; color: # ffffff; padding-top: 8px; border-bottom: # ffffff 1px solid; Height: 100% '> <font color = # ee0000> "+ this. title + "</font> <br>"
STR + = "<Div style = 'word-break: Break-all 'align = left> <a href = 'javascript: void (0) 'hidefocus = true id = 'btcommand'> <font color = # ee0000> "+ this. message + "</font> </a> </div>"
STR + = "</div>"
STR + = "</TD>"
STR + = "</tr>"
STR + = "</table>"
STR + = "</div>"
Opopup.doc ument. Body. innerhtml = STR;
This. offset = 0;
VaR me = this;
Opopup.doc ument. Body. onmouseover = function () {me. Pause = true ;}
Opopup.doc ument. Body. onmouseout = function () {me. Pause = false ;}
VaR fun = function ()
{
VaR x = me. Left;
Var y = 0;
VaR width = me. width;
VaR Height = me. height;
If (Me. Offset> me. Height)
{
Height = me. height;
} Else
{
Height = me. offset;
}
Y = me. Bottom-Me. offset;
If (Y <= me. Top)
{
Me. Timeout --;
If (Me. Timeout = 0)
{
Window. clearinterval (Me. Timer );
If (Me. autohide)
{
Me. Hide ();
}
}
}
Else
{
Me. offset = me. Offset + me. Step;
}
Me. Pop. Show (X, Y, width, height );
}
This. Timer = Window. setinterval (fun, this. Speed)
VaR btclose = opopup.doc ument. getelementbyid ("btsysclose ");
Btclose. onclick = function ()
{
Me. Close = true;
Me. Hide ();
}
VaR btcommand = opopup.doc ument. getelementbyid ("btcommand ");
Btcommand. onclick = function ()
{
Me. oncommand ();
}
}
// Set the speed
Messshow. Prototype. speed = function (s)
{
VaR T = 10;
Try
{
T = praseint (s );
}
Catch (e ){}
This. speed = T;
}
// Step size setting method
Messshow. Prototype. Step = function (s)
{
VaR t = 2;
Try
{
T = praseint (s );
}
Catch (e ){}
This. Step = T;
}
Messshow. Prototype. rect = function (left, right, top, bottom)
{
Try
{
This. Left = left? Left: 0;
This. Right = right? Right: screen. availwidth-1;
This. Top = Top? Top: 0;
This. Bottom = bottom? Bottom: screen. availheight;
}
Catch (E)
{}
}
Function load ()
{
VaR MSG = new messshow ("hello", 250,150, "info", "Wings of light, hello! "," QQ: 272912705 requests are added as friends! "," _ Bank ", 'HTTP: // www.baidu.com ');
MSG. Show ();
}
</SCRIPT>
</Head>
<Body onload = "load ()">
<Form ID = "form1" runat = "server">
<Div>
</Div>
</Form>
</Body>