Align the bottom of the DIV page [Extract and modify]

Source: Internet
Author: User

<Script language = "javascript" type = "text/javascript">
Function $ ()
{
Return document. getElementById? Document. getElementById (arguments [0]): eval (arguments [0]);
}
Var Sys = {};
Var ua = navigator. userAgent. toLowerCase ();
If (window. ActiveXObject)
Sys. ie = ua. match (/msie ([\ d.] +)/) [1]
Else if (document. getBoxObjectFor)
Sys. firefox = ua. match (/firefox \/([\ d.] +)/) [1]
Else if (window. MessageEvent &&! Document. getBoxObjectFor)
Sys. chrome = ua. match (/chrome \/([\ d.] +)/) [1]
Else if (window. opera)
Sys. opera = ua. match (/opera. ([\ d.] +)/) [1]
Else if (window. openDatabase)
Sys. safari = ua. match (/version \/([\ d.] +)/) [1];

Function getClientBounds ()
{
Var clientWidth;
Var clientHeight;

If (Sys. ie)
{
ClientWidth = document. body. clientWidth;
ClientHeight = document. body. clientHeight;
}
Else if (Sys. safari)
{
Clientwidth = Window. innerwidth;
Clientheight = Window. innerheight;
}
Else if (SYS. Opera)
{
Clientwidth = math. Min (window. innerwidth, document. Body. clientwidth );
Clientheight = math. Min (window. innerheight, document. Body. clientheight );
}
Else
{
ClientWidth = Math. min (window. innerWidth, document.doc umentElement. clientWidth );
ClientHeight = Math. min (window. innerHeight, document.doc umentElement. clientHeight );
}
 
Return {width: clientWidth, height: clientHeight };
}
 
Function resetlivemessgerposition ()
{
Var clientBounds = getClientBounds ();
Var container = document. getElementById ("liveMessengerContainer ");

Var scrollLeft = (document.doc umentElement. scrollLeft?
Document.doc umentElement. scrollLeft: document. body. scrollLeft );
Var scrollTop = (document.doc umentElement. scrollTop?
Document.doc umentElement. scrollTop: document. body. scrollTop );

Var containerLeft = scrollLeft + clientBounds. width-container. clientWidth-5;
Var containerTop = scrollTop + clientBounds. height-container. clientHeight;

$ ("LiveMessengerContainer"). style. top = containerTop + "px ";
$ ("LiveMessengerContainer"). style. left = containerLeft + "px ";
}

Window. onscroll = function () {resetlivemessential gerposition ();};
Window. onresize = function () {resetlivemessential gerposition ();};
Window. onload = function () {resetLiveMessengerPosition ();};
</Script>

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.