Simulate the QQ and MSN Short Message Prompt window

Source: Internet
Author: User

<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
When (I> 500) closediv ()
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>
<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 = # cfdef4 border = 0>
<Tbody>
<Tr>
<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: # 1f336b; padding-top: 4px; padding-left: 4px "valign = center width =" 100% "> Short Message prompt: </TD>
<TD style = "background-image: url(msgtopbg.gif); padding-top: 2px; padding-right: 2px "valign = center align = right width = 19> <span Title = close style =" cursor: hand; color: red; font-size: 12px; font-weight: bold; margin-Right: 4px; "onclick = closediv ()> × </span> <! -- --> </TD>
</Tr>
<Tr>
<TD style = "padding-Right: 1px; Background-image: url(1msgbottombg.jpg); 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% "> you have <font color = # ff0000> 1 </font> new messages <br>
<Div align = center style = "word-break: Break-all"> <a href = "http: // blog. csdn. net/applebbs "target =" _ blank "> <font color = # ff0000> σ Dicky's blog σ </font> </a> </div>
</Div>
</TD>
</Tr>
</Tbody>
</Table>
</Div>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.