页面底部自适应浏览器窗口高度

if($(document.body).height() < $(window).height()){
$("#footer").css({position:'fixed',bottom:0,width:'100%'});
}
$(window).resize(function() {
if($(document.body).height() < $(window).height()){
$("#footer").css({position:'fixed',bottom:0,width:'100%'});
}else{
$("#footer").css({position:'relative'});
}
});

posted @ 2014-08-22 16:50  hasayaki  阅读(332)  评论(0编辑  收藏  举报