問題:
jQuery を使用してフッターをページの下部に揃えています。FF で動作しますが、IE、Chrome、および Safari ではフッターが約 50 ~ 100 ピクセル押し下げられます。
自分で見て:
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>
私の質問:
ページの下部にフッターが沈む原因は何ですか?