Skip to content

Instantly share code, notes, and snippets.

@maebert
Created February 25, 2014 00:11
Show Gist options
  • Save maebert/9200039 to your computer and use it in GitHub Desktop.
Save maebert/9200039 to your computer and use it in GitHub Desktop.
// Without jQuery:
var setSplashHeight = function () {
document.getElementById("splash").style.height = "innerHeight" in window ? window.innerHeight : document.documentElement.offsetHeight;
}
setSplashHeight();
window.onresize = setSplashHeight();
// With jQuery:
var jSetSplashHeight = function () {
$("#splash").height($(window).height());
}
$(window).bind('onresize', jSetSplashHeight);
jSetSplashHeight();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment