Skip to content

Instantly share code, notes, and snippets.

@ZhNatali
Created November 16, 2016 16:01
Show Gist options
  • Save ZhNatali/b975dbb5fefa14bc50ebb690d172798e to your computer and use it in GitHub Desktop.
Save ZhNatali/b975dbb5fefa14bc50ebb690d172798e to your computer and use it in GitHub Desktop.

Revisions

  1. ZhNatali created this gist Nov 16, 2016.
    29 changes: 29 additions & 0 deletions jQuery Page Preload
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    #loader {
    background: none repeat scroll 0 0 #ffffff;
    bottom: 0;
    height: 100%;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 9999;
    }
    #loaderInner {
    background-image: url("../img/load.gif");
    background-repeat: no-repeat;
    background-position: center center;
    background-color: #fff;
    height: 60px;
    width: 60px;
    margin-top: -30px;
    margin-left: -30px;
    left: 50%;
    top: 50%;
    position: absolute;
    }

    $(window).load(function() {
    $("#loaderInner").fadeOut();
    $("#loader").delay(400).fadeOut("slow");
    });