Last active
December 17, 2015 00:19
-
-
Save hlotvonen/5520586 to your computer and use it in GitHub Desktop.
Snippet for a div to be 100% - 100px of browser window height
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
$(document).ready(function() { | |
// for a div to be 100% - 100px of browser window height | |
var windowheight = $(window).height(); | |
var newheight = windowheight - 100; | |
$("#landing-section").height(newheight); | |
}); | |
// with window resize | |
$(window).resize(function() { | |
var windowheight = $(window).height(); | |
var newheight = windowheight - 100; | |
$("#landing-section").height(newheight); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment