最下部に要素を固定する

Ads

Result

jQuery

//IEに読ませるコード
if ( $.browser.msie ) {
    div.css({position: "absolute", width: jslide_width, right: 0, height: 100});
    div.addClass('fixie');
} else {//IE以外のブラウザ
    div.css({position: "fixed", width: jslide_width, right: 0, height: 100});
}

css

.footer { 
    position:fixed; 
    position:absolute; 
    right:0; 
    bottom:0; 
    padding:0; 
    margin:0; 
    height:100px;
    width:100%;
    background:#eee;
    text-align:center;
}
 
/*IE FIX*/
.fixie {
  left: expression( ( - jsrp_related.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
  top: expression( ( - jsrp_related.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}

html

<div class="header">header</div>
<div class="content">content</div>
<div class="footer">footer</div>

via

jQuery Keep Div on Bottom of Screen | jQuery4u