Created
June 17, 2016 13:14
-
-
Save whitershade/8044d24cb2b92835baac2fdd7b2ba39d to your computer and use it in GitHub Desktop.
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
JS | |
let mainHeader = document.getElementById('main-header'); | |
setMainHeaderHeight(); | |
window.onresize = function () { | |
setMainHeaderHeight(); | |
} | |
function setMainHeaderHeight() { | |
let height; | |
if (typeof document.height !== 'undefined') { | |
height = document.height // For webkit browsers | |
} else { | |
height = document.documentElement.clientHeight; | |
} | |
(height > 1200) && (height = 1200); | |
mainHeader.style.minHeight = `${height}px`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment