There are white edges in the versions found online. today, I took the time to improve it. You should see it when you open the page. if Ajax is used in combination with Outlook notifications Based on Web pages, it will be used a little bit. first of all, I would like to thank the original author (too many reposted and I cannot find them ).
Display Effect:
In fact, some people have made a better version, refer to here (also only supports IE ):
Web desktop reminder effect Demo: http://webuc.net/MyProject/Popup/popup.htm
Download: http://webuc.net/MyProject/Popup/popup.rar
<SCRIPT>
VaR opopup;
Try {
Opopup = Window. createpopup ();
} Catch (e ){
Window. Status = 'pop-up notification messages can only be used in IE! ';
}
VaR PopTop = 10;
VaR mytime;
Function popmsg (msgstr ){
If (! Opopup ){
Return;
}
Opopup.doc ument. Body. innerhtml = msgstr;
Popshow ();
}
Function popshow (){
// Window. Status = PopTop;
If (PopTop & gt; 1720 ){
Cleartimeout (mytime );
Opopup. Hide ();
Return;
} Else if (PopTop> = 1720-108 & PopTop <= 1720 ){
Opopup. Show (screen. Width-200, screen. Height, 193,172 0-PopTop );
} Else if (PopTop> = 1500 & PopTop <1720-108 ){
Opopup. Show (screen. Width-200, screen. Height-220 + (PopTop-1500), 193,108 );
} Else if (PopTop <= 108 ){
Opopup. Show (screen. Width-200, screen. Height, 193, PopTop );
}
Else if (PopTop <= 220 ){
Opopup. Show (screen. Width-200, screen. Height-PopTop, 193,108 );
} Else {
// Window. Status = PopTop + "else ";
Opopup. Show (screen. Width-200, screen. Height-220,193,108 );
}
PoPToP + = 10;
Mytime = setTimeout ("popshow ();", 40 );
}
Function hidepop (){
Cleartimeout (mytime );
Opopup. Hide ();
}
Popmsg ("<Div onclick = 'window. parent. hidepop () 'title = 'click to hide 'style = 'cursor: pointer; Background-image: URL (http://www.blogjava.net/images/blogjava_net/beansoft/18269/o_qqbg.gif); width: 193; Height: 108; color: white; padding-top: 1em; padding-left: 5; font-size: 11pt; color: white '> <center> <B> blogjava system message <br> Please leave a message or donate money to support beansoft's Java EE learning video. Thank you !! </B> </center> </div> ");
</SCRIPT>
Finally, we provide a cross-browser support page:
The advertisement code pops up in the lower-right corner of MSN and can disappear automatically. The close button is attached.
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> xianfei Computer Technology Network </title>
</Head>
<Script language = "JavaScript">
<! --
Window. onload = getmsg;
Window. onresize = resizediv;
Window. onerror = function (){}
// SMS reminder (asilas added)
VaR divtop, divleft, divwidth, divheight, docheight, docwidth, objtimer, I = 0;
Function getmsg ()
{
Try {
Divtop = parseint (document. getelementbyid ("emeng"). style. Top, 10)
Divleft = parseint (document. getelementbyid ("emeng"). style. Left, 10)
Divheight = parseint (document. getelementbyid ("emeng"). offsetheight, 10)
Divwidth = parseint (document. getelementbyid ("emeng"). offsetwidth, 10)
Docwidth = Document. Body. clientwidth;
Docheight = Document. Body. clientheight;
Document. getelementbyid ("emeng"). style. Top = parseint (document. Body. scrolltop, 10) + docheight + 10; // divheight
Document. getelementbyid ("emeng"). style. Left = parseint (document. Body. scrollleft, 10) + docwidth-divwidth
Document. getelementbyid ("emeng"). style. Visibility = "visible"
Objtimer = Window. setinterval ("movediv ()", 10)
}
Catch (e ){}
}
Function resizediv ()
{
I + = 1
If (I> 300) closediv () // if the customer wants to disable it automatically, the user will disable it.
Try {
Divheight = parseint (document. getelementbyid ("emeng"). offsetheight, 10)
Divwidth = parseint (document. getelementbyid ("emeng"). offsetwidth, 10)
Docwidth = Document. Body. clientwidth;
Docheight = Document. Body. clientheight;
Document. getelementbyid ("emeng"). style. Top = docheight-divheight + parseint (document. Body. scrolltop, 10)
Document. getelementbyid ("emeng"). style. Left = docwidth-divwidth + parseint (document. Body. scrollleft, 10)
}
Catch (e ){}
}
Function movediv ()
{
Try
{
If (parseint (document. getelementbyid ("emeng"). style. Top, 10) <= (docheight-divheight + parseint (document. Body. scrolltop, 10 )))
{
Window. clearinterval (objtimer)
Objtimer = Window. setinterval ("resizediv ()", 1)
}
Divtop = parseint (document. getelementbyid ("emeng"). style. Top, 10)
Document. getelementbyid ("emeng"). style. Top = divtop-1
}
Catch (e ){}
}
Function closediv ()
{
Document. getelementbyid ('emeng'). style. Visibility = 'den den ';
If (objtimer) window. clearinterval (objtimer)
}
-->
</SCRIPT>
<! -- A Warm Reminder to start code -->
<Div id = emeng style = "border-Right: #455690 1px solid; border-top: # a6b4cf 1px solid; Z-INDEX: 99999; left: 0px; visibility: hidden; border-left: # a6b4cf 1px solid; width: 180px; border-bottom: #455690 1px solid; position: absolute; top: 0px; Height: pixel PX; Background-color: # c9d3f3 ">
<Table Style = "border-top: # ffffff 1px solid; border-left: # ffffff 1px solid "cellspacing = 0 cellpadding = 0 width =" 100% "bgcolor = # afdcf3 border = 0>
<Tbody>
<Tr bgcolor = # 6699cc>
<TD style = "font-size: 12px; Background-image: url('msgtopbg.gif '); color: # 0f2c8c" width = 30 Height = 24> </TD>
<TD style = "font-weight: normal; font-size: 12px; Background-image: url('msgtopbg.gif '); color: # ffffff; padding-left: 4px; padding-top: 4px "valign = center width =" 100% "> tips: </TD>
<TD style = "background-image: url('msgtopbg.gif '); padding-Right: 2px; padding-top: 2px "valign = center align = right width = 19> <span Title = close style =" cursor: hand; color: White; font-size: 12px; font-weight: bold; margin-Right: 4px; "onclick = closediv ()> × </span> <! -- --> </TD>
</Tr>
<Tr>
<TD style = "background-image: URL ('HTTP: // pic.tianyaclub.com/images/windty_bg.jpg'); padding-Right: 1px; padding-bottom: 1px" colspan = 3 Height = 90>
<Div style = "border-Right: # b9c9ef 1px solid; padding-Right: 13px; border-top: #728eb8 1px solid; padding-left: 13px; font-size: 12px; padding-bottom: 13px; border-left: #728eb8 1px solid; width: 100%; color: # 1f336b; padding-top: 18px; border-bottom: # b9c9ef 1px solid; Height: 100% "> the first flying computer technology network is upgraded to a new version. It provides free high-quality network resources. Have you used it? <Br>
<Div align = center style = "word-break: Break-all"> <! -- <A href = "http://pic.tianyaclub.com/default.asp? Idwriter = 0 & Key = 0 "target =" _ blank "> --> <a href =" http://www.xfbbs.com "target =" _ blank ">
<Font color = # ff0000> browse the website </font> </a> </div>
</Div>
</TD>
</Tr>
</Tbody>
</Table>
</Div>
<! -- A warm reminder that the code is over -->
</Html>