/ Published in: jQuery
Expand |
Embed | Plain Text
if($('body').height() < $(window).height()){ $("#footer").css({position: "absolute",top:($(window).height()-$("#footer").height())+"px", width: "100%"}) }
Comments
Subscribe to comments
You need to login to post a comment.

Another
function placeFooter() { console.log('Placing footer:'); var docHeight = $(document.body).height(); var winHeight = $(window).height(); console.log('Document Body Height: ' + docHeight); console.log('Windows Height: ' + winHeight); if( docHeight < winHeight ) { console.log("Footer being moved."); $("#footer").css({position: "absolute", bottom:"0px",zIndex:"-100"}); } else { $("#footer").css({position: ""}); } }
placeFooter();