Advertisement
afsarwebdev

JS Preloader

Jul 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. //HTML
  2. <div id="preloader">
  3. <div id="status">&nbsp;</div>
  4. </div>
  5. //CSS
  6.  
  7. /*PRELOADER STYLE*/
  8. #preloader {
  9. position: fixed;
  10. top: 0;
  11. left: 0;
  12. right: 0;
  13. bottom: 0;
  14. background-color: #fff;
  15. z-index: 99;
  16. }
  17.  
  18. #status {
  19. width: 200px;
  20. height: 200px;
  21. position: absolute;
  22. left: 50%;
  23. top: 50%;
  24. transform: translate(-50%, -50%);
  25. background-image: url('../images/preloader.gif');
  26. background-repeat: no-repeat;
  27. background-position: center center;
  28. background-size: cover;
  29. }
  30. //JS
  31. $(window).on('load', function() {
  32. $('#status').fadeOut();
  33. $('#preloader').delay(1000).fadeOut('slow');
  34. $('body').delay(1000).css({'overflow':'visible'});
  35. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement