Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .preloader
- position: fixed
- top: 0
- left: 0
- right: 0
- bottom: 0
- background-color: #fff /* change if the mask should have another color then white */
- z-index: 9 /* makes sure it stays on top */
- .preloader-inner
- width: 80px
- height: 80px
- background-size: cover
- position: absolute
- left: 50% /* centers the loading animation horizontally one the screen */
- top: 50% /* centers the loading animation vertically one the screen */
- background-image: url(../img/preloader.gif) /* path to your loading animation */
- background-repeat: no-repeat
- background-position: center
- margin: -30px 0 0 -30px /* is width and height divided by two */
- $(window).on('load', function() { // makes sure the whole site is loaded
- $('.preloader-inner').fadeOut(); // will first fade out the loading animation
- $('.preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
- })
Add Comment
Please, Sign In to add comment