How to Add Preloader Spinner to BlogSpot Blogs

Have you seen a website that displays an animated object before page rendering? Yes, you may have seen this type of site that shows a Preloader before showing its contents. In my previous post, I showed you how to Add jQuery Tabs set and Accordion to BlogSpot. But today, we will learn how to install a preloader to your Blogger theme. This gadget is developed with CSS and a piece of jQuery code. You need to install those snippets to your theme by following the steps mentioned here.

Preloader-for-Blogger

How Preloader Spinner Work?

When you visit a preloader enabled web page, an animated object appears for a few moments, and during this time, the site contents remain invisible. When preloader completes its loading process to the marked time, it fades away, and the contents of the site become visible.

Check out: How to Load Google Fonts Faster In Blogger Template

This spinner loader can be shown anywhere on your Blogger blogs. You can choose the only homepage, only post pages, only static pages and only on a particular page/post. However, I would recommend to display it only on the homepage. By applying this effect to your entire blog, you need to reconsider the concept of good user experience.

Recommended: 13 Penalized SEO Exercise You Need to Think About

Adding Preloader Screen to Blogger

Before you make any change in your Blogger theme, make sure you backup your template in case if you make any mistake with your edits, you can just revert your blog layout to its previous state by restoring it from your hard drive.

  1. Login to your BlogSpot Dashboard > Theme > Edit HTML
  2. Click inside the theme editor > Press Ctrl + F
  3. A search box will appear and type <head> > Press Enter key
  4. Paste the following code right below it
  5. <link href='//cdn.rawgit.com/knigulper/github.io/gh-pages/www.knigulper.com/Preloader2.css' rel='stylesheet'/> <script>$(document).ready(function() {  setTimeout(function(){   $(&#39;body&#39;).addClass(&#39;loaded&#39;);   $(&#39;h1&#39;).css(&#39;color&#39;,&#39;#222222&#39;);  },  3000 ); });</script>
  6. Now search for the </head> and add the given code right below it
  7. <body class='demo'> <div id='demo-content'> <div id='loader-wrapper'> <div id='loader'/> <div class='loader-section section-left'/> <div class='loader-section section-right'/> </div> </div> </body>

    Decide Where to Show The Preloader

    To show or hide the widgets, gadgets or any other plugin on your Blogger blogs, you need to apply the conditional tags as per your requirement.

    To Show Preloader only on Homepage
    <b:if cond='data:blog.url == data:blog.homepageUrl'> Code-Goes-Here </b:if>
    To Hide Preloader only on Posts:
    <b:if cond='data:blog.pageType == "item"'> Code-Goes-Here</b:if>
    To Show Preloader only on Static Pages
    <b:if cond='data:blog.pageType == "static_page"'> Code-Goes-Here </b:if>
    To Show Preloader on Specific Pages:
    <b:if cond='data:blog.url == "URL of the page"'> Code-Goes-Here</b:if>
    To Hide Preloader on a Specific Pages:
    <b:if cond='data:blog.url != "URL of the page"'> Code-Goes-Here </b:if>
    To Show Preloader only on Static Pages:
    <b:if cond='data:blog.pageType == "static_page"'> Code-Goes-Here </b:if>
    To Hide Preloader only on Static Pages:
    <b:if cond='data:blog.pageType != "static_page"'> Code-Goes-Here </b:if>

    After applying the conditional tags, replace the red text with the preloader code that you found on step number 5

  8. Finally, click Save Theme.

Now your Preloader is ready to work. Enjoy

Comments

  1. brother i add it but it keeps on loading without displaying blog

    ReplyDelete
  2. i add it but it keeps on loading without displaying blog

    ReplyDelete
  3. bro i add it but it keeps on loading without displaying blog

    ReplyDelete
  4. My blog only loading content not shown

    ReplyDelete
  5. Dear Bloggers! if you are having a problem with this Preloader like Loader is keep loading and doesn't go off and your website is not appearing, then follow my steps.

    The above codes are fine. There is only a problem that admin of the post didn't told exactly where to place there codes.

    So, Let's get started.

    REMEMBER: Remove the %.

    Step 1: Place this Code BELOW <%head>

    <%link href='//cdn.rawgit.com/knigulper/github.io/gh-pages/www.knigulper.com/Preloader2.css' rel='stylesheet'/>




    Step 2: Place this code BELOW <%/head>

    <%body class='demo'>
    <%div id='demo-content'>
    <%div id='loader-wrapper'>
    <%div id='loader'/>
    <%div class='loader-section section-left'/>
    <%div class='loader-section section-right'/>
    <%/div>
    <%/div>
    <%/body>



    Step 3: Place this code ABOVE <%/body>

    <%script>$(document).ready(function() { setTimeout(function(){ $('body').addClass('loaded'); $('h1').css('color','#222222'); }, 3000 ); });<%/script>

    That's it.

    If your is now solved, Please pass a smile and do remember me in your prayers :-) and i request to the admin, if you read my Comment, Please update the post.

    ReplyDelete
  6. Thanks so much just what i wanted.

    If you need a sport betting prediction tips and also sport news.

    CLick here now - https://www.9jacentral.com.ng

    ReplyDelete
  7. https://www.megaflash.online

    ReplyDelete

Post a Comment

Popular posts from this blog

List of Top 11 Social Bookmarking Sites for 2018

6 Digital Marketing Strategies for Small Business

How to Create Separate AMP Pages On Blogger [AMP Plugin]