[Posting] Now I am working on a website messaging system, and a rising window will pop up from the toolbar.

Source: Internet
Author: User

Now we are working on a website messaging system,
When a user logs in,
If there are unread Short Messages
Then, a rising window will pop up from the toolbar.
Display reminder information!

<Script language = "JavaScript" type = "text/JavaScript">
VaR divtop, divleft, divwidth, divheight, docheight, docwidth, objtimer, I = 0;
Function getmsg ()
{
Try {
Window. Open ("Top. aspx", "topmusic ");
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> 1288) 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)
}
Window. onload = getmsg;
Window. onresize = resizediv;
Window. onerror = function (){}
</SCRIPT>

Related connections:

Http://www.eeeksoft.net/files/popuptest/Default.aspx

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.