我使用了粘性页脚 jquery 解决方案来让页脚始终位于页面底部。有用。因此,当我在全屏模式下使用浏览器加载页面时,页脚位于底部,当我调整浏览器大小时,页脚不会移动并掩盖我想要的内容。但是,如果浏览器已经用小分辨率调整大小,页脚会显示并覆盖内容。我怎样才能阻止这种情况发生?
jQuery:
<script type="text/javascript">
$(document).ready(function () {
var docHeight = $(window).height();
var footerHeight = $('#footer').height();
var footerTop = $('#footer').position().top + footerHeight;
if (footerTop < docHeight) {
$('#footer').css('margin-top', 10 + (docHeight - footerTop) + 'px');
}
});
// -->
页脚规则
#footer {
bottom:0;
background-color:#000000;
height: 130px;
width: 100%;
clear:both;
}