Created
August 1, 2013 16:30
-
-
Save raphaelchaib/6132990 to your computer and use it in GitHub Desktop.
Javascript: Make #main's height go to footer and fill up all the page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Make #main's height go to footer and fill up all the page | |
| jQuery(document).ready(function() { | |
| // Size that main have to be | |
| var mainPredefinedHeight = jQuery(window).height() | |
| - jQuery('#header').outerHeight(true) | |
| - jQuery('#footer').outerHeight(true) | |
| - parseInt(jQuery('#main').css('paddingBottom')) | |
| ; | |
| if( jQuery('#main').height() < mainPredefinedHeight) { | |
| jQuery('#main').height( mainPredefinedHeight ) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment