I'm using jQuery to align my footer to the bottom of a page. It works in FF but IE, Chrome and Safari push the footer down by about 50-100px.
Look at the footer of www.directsponsor.org to see a live example of the problem.
<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>
What's causing the footer to sink below the bottom of the page?
try this : http://www.codicode.com/art/the_best_sticky_footer.aspx this code also uses jQuery and works perfectly on all browsers.
hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.