Saturday 12 August 2017

sati007 :: Add preloder to website, Preloader to your website, seo links

Add Preloader to your website




  1. Before you can add preloader to your website, Make sure that you have added jQuery to your webpage. If you haven’t already then place the following code within your <head> tag.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  1. Immediately after the above placed line of code, copy-paste the following code.
<script>
    jQuery(window).load(function(){
        jQuery(".hameid-loader-overlay").fadeOut(500);
    });
</script>
The above code is to fade out the preloader animation once the page has been completely loaded.
  1. Now, add the following CSS code in your stylesheet. Make sure that the path to the background image is set correctly.
.hameid-loader-overlay {
    width: 100%;
    height: 100%;
    background: url('images/preloader.gif') center no-repeat #FFF;
    z-index: 99999;
    position: fixed;
}
If you want a transparent background, You can use the opacity CSS property.
  1. Just after your <body> tag, Place the following piece of code.
<div class="hameid-loader-overlay"></div>
  1. Refresh your page now. You should now see the preloader animation while your page is loading. We’re done, right? Not really. Disable Javascript in your browser, The preloader screen will stay forever. Not everyone has JavaScript enabled in their browser. To fix that we disable the preloader if JavaScript is disabled by adding the following within the tag.
<noscript>
    <style>.hameid-loader-overlay { display: none; } </style>
</noscript>
That’s it. Now, You have added preloader to your website. Also, If JavaScript is disabled in the browser, The preloader is not shown at all.


https://sati007.blogspot.in

No comments:

sati007 :: Compress JPEG images

How to Compress JPEG to 50KB Online : * Drag and drop Multiple JPEG, PNG into the Given URL. 🗂 * Choose the ‘Basic Compression’ option. 👉 ...