Created
March 14, 2014 15:17
-
-
Save yyoshiki41/9549772 to your computer and use it in GitHub Desktop.
Set min_height
This file contains 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
// #contents { min-height: } | |
function getBrowserHeight() { | |
if ( window.innerHeight ) { | |
return window.innerHeight; | |
} | |
else if ( document.documentElement && document.documentElement.clientHeight != 0 ) { | |
return document.documentElement.clientHeight; | |
} | |
else if ( document.body ) { | |
return document.body.clientHeight; | |
} | |
return 0; | |
} | |
var header = document.getElementsByTagName('header'), | |
footer = document.getElementsByTagName('footer'), | |
contents = document.getElementById('centents'), | |
height_header = header[0].clientHeight, | |
height_footer = footer[0].clientHeight, | |
height_contents = getBrowserHeight() - height_header - height_footer; | |
contents.style.minHeight = height_contents+="px"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment