[JavaScript] keeps footer at the bottom of the page (footer all the way at the bottom of the page)

Source: Internet
Author: User

The company version information is always kept at the bottom of the webpage. How can this information be implemented? The following section of JavaScript demonstrates how to keep footer at the bottom of the page. This sectionCodeI am not very perfect in actual use. When pages and controls that contain other JavaScript controls overlap, this is because the onresize and onload operations are not performed on the page body. I hope you can solve the problem later)

< Html >
< Head >
< Title > Keep footer at the bottom of the page </ Title >

< Script Language = "JavaScript" >
<! --
Function Movefooter (){
VaR Ibottom =   0 ;

If (Document. All ){
If (Parseint (document. Body. scrollheight) > Parseint (document. Body. clientheight )){
Ibottom = Parseint (document. Body. scrollheight );
}
Else Ibottom = Parseint (document. Body. clientheight );
Document. All [ " Lyfooter " ]. Style. pixeltop = Ibottom - Parseint (document. All [ " Lyfooter " ]. Style. Height );
Document. All [ " Lyfooter " ]. Style. Visibility =   " Visible " ;
}
Else   If (Document. layers ){
If (Document. Height > Self. innerheight ){
Ibottom = Document. height;
}
Else Ibottom = Self. innerheight;
Document. Layers [ " Lyfooter " ]. Top = Parseint (ibottom - Document. Layers [ " Lyfooter " Pai.doc ument. Height );
Document. Layers [ " Lyfooter " ]. Visibility =   " Visible " ;
}
Else   If (Document. getelementbyid ){ // Ns6
If (Document. Height > Self. innerheight ){
Ibottom = Document. height;
}
Else Ibottom = Self. innerheight;
Document. getelementbyid ( " Lyfooter " ). Style. Top = (Parseint (ibottom - Parseint (document. getelementbyid ( " Lyfooter " ). Style. Height ))) +   " Px " ;
Document. getelementbyid ( " Lyfooter " ). Style. Visibility =   " Visible " ;

}

}
// -->
</ Script >
</ Head >

< Body Ms_positioning = "Gridlayout" Onresize = "Movefooter ()" Onload = "Movefooter ()" >
< Form ID = "Form1" Method = "Post" >
<! -- -- Bottom part ------- -->
< Div ID = "Lyfooter" Style = "Position: absolute; left: 0px; top: 100px; Height: 19px; Z-index: 2; visibility: hidden ;" >
< Table Border = "0" Width = "100%" Cellspacing = "0" Cellpadding = "3" >
< Tr >
< TD Width = "100%" Bgcolor = "#319a63" Class = "Footnote" > < Font Color = "# Ffffff" Size = "2px" Face = "Verdana, Arial, Helvetica, sans-serif" > & Copy;  
2005 ABCDE, Inc. </ Font > </ TD >
</ Tr >
</ Table >
</ Div >
<! -- --/Bottom part ------- -->
</ Form >
</ Body >
</ Html >

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.