Skip to content

Instantly share code, notes, and snippets.

@luishdez
Created December 4, 2010 07:52
Show Gist options
  • Select an option

  • Save luishdez/728021 to your computer and use it in GitHub Desktop.

Select an option

Save luishdez/728021 to your computer and use it in GitHub Desktop.
Fix footer striking theme
footer_fix = function() {
var w = jQuery(window).height();
var b = jQuery('body').height();
var o = jQuery('#page_bottom');
var h = parseInt(o.css('margin-top'));
if(w > b) {
o.css('margin-top', h + w-b);
}
else if(h>0) {
if(h-(b-w) >= 0) o.css('margin-top', h-(b-w));
}
}
footer_fix();
/* Prevent IE Slow renders */
window.setInterval(footer_fix,50);
window.setInterval(footer_fix,150);
window.setInterval(footer_fix,250);
jQuery(window).resize(footer_fix);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment