Last active
January 13, 2017 19:09
-
-
Save SashaKolbasov/c0055cff4fb138e3942ca4fdcbd540fb to your computer and use it in GitHub Desktop.
Easy Preloader
This file contains 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
<div id="preloader" class="preloader"><span class="spinner"></span></div> |
This file contains 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
$(window).on('load', function () { | |
var $preloader = $('#preloader'), | |
$spinner = $preloader.find('.spinner'); | |
$spinner.delay(150).fadeOut(); | |
$preloader.delay(350).fadeOut(300); | |
}); |
This file contains 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
.preloader { | |
position: fixed; | |
left: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
background-color: #131F23; | |
z-index: 100500; | |
.spinner { | |
width: 32px; | |
height: 32px; | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
background: url('../img/icons/ajax-loader.gif') no-repeat 50% 50%; | |
margin: -16px 0 0 -16px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment