Skip to content

Instantly share code, notes, and snippets.

@maebert
Created February 25, 2014 00:11

Revisions

  1. maebert created this gist Feb 25, 2014.
    14 changes: 14 additions & 0 deletions set_splash_height.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // 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();