Advertisement
shakil97bd

Add a preloader in your website

Jun 28th, 2015
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.30 KB | None | 0 0
  1. *************************** Add a preloader in your website ********************************
  2.  
  3. Add this html markup under the <body> start tag....
  4. ======================================================
  5. <div id="preloader">
  6.     <div id="status"></div>
  7. </div>
  8.  
  9.  
  10. Add this CSS style in your style.css file
  11. ================================================
  12.  
  13. #preloader{
  14.     position:fixed;
  15.     top:0;
  16.     left:0;
  17.     right:0;
  18.     bottom:0;
  19.     width:100%;
  20.     height:100%;
  21.     z-index:9999;
  22.     background-color:#fff;
  23.     opacity:1;
  24. }
  25.  
  26. #status{
  27.     position:absolute;
  28.     top:50%;
  29.     left:50%;
  30.     width:200px;
  31.     height:200px;
  32.     margin:-100px 0px 0px -100px;
  33.     background-image:url('../images/preloader/preloader2.gif');
  34.     background-repeat:no-repeat;
  35.     background-position:center
  36. }
  37.  
  38.  
  39. Add this js code in your main.js file
  40. ============================================
  41.  
  42. //preloader
  43. jQuery(window).load(function(){
  44.     jQuery("#status").fadeOut();
  45.     jQuery("#preloader").delay(500).fadeOut("slow");
  46. });
  47.  
  48.  
  49.  
  50.  
  51.  
  52. You can also add a preloader with jquery plugin.There have some preloader plugin name and link
  53. ====================================================================================================
  54.  
  55. fakeLoader.js       >>>>>>  https://github.com/joaopereirawd/fakeLoader.js
  56. queryloader2        >>>>>>  https://github.com/Gaya/queryloader2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement