1
问题:
我正在使用jQuery将页脚对齐到页面底部。它适用于FF,但IE,Chrome和Safari将页脚降低约50-100px。粘性页脚(jQuery)将不会完全对齐页面底部
见自己:
看的www.directsponsor.org页脚看到问题的一个活生生的例子。
代码:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
matchHeight();
function matchHeight() {
var mainHeight = $("#wrapper").outerHeight() - $("#header").outerHeight() - $("#leader").outerHeight() - $("#footer").outerHeight() - parseInt($("#footer").css("margin-top")) - 1 - parseInt($("#main").css("padding-top"))- parseInt($("#main").css("padding-bottom"));
var mainReal = $("#main").outerHeight(true);
if ((mainHeight + 1 + parseInt($("#main").css("padding-top")) + parseInt($("#main").css("padding-bottom"))) > mainReal) {
$('#main').height(mainHeight);
}
}
$(window).resize(matchHeight);
});
</script>
我的问题:
是什么造成页脚下沉页面的底部之下?
最后,一个跨浏览器的解决方案。如果遇到任何问题,我会重新报告。谢谢。 –
您需要改进此答案才能不依赖于您网站的链接。否则它将被删除。 – ThiefMaster