Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet for a div to be 100% - 100px of browser window height
$(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