Showing actionable and animated page loader with image or CSS until the web page loads completely on any website included Blogger keep patient visitors or users with little entertainment. But searching on Google, you can see a lot of articles are available with large number of code what will bad impact on your website. For better search engine optimization it is harmful.

Disadvantage: Blogger Layout option may not appear properly.

This article will help you about how to show animated and spinner page loader on your Blog or website STEP-BY-STEP with LESS CODE.

Though it is based on Blogger platform, you can apply this method on different platform manually.

STEP-1: Add HTML and JavaScript
Go to Blogger Dashboard and Theme option. Then Edit HTML to enable in edit mode. Now search for (Ctrl + F) <body and replace with the following code.
<body onload='myFunctionLoader()' style='margin:0'><div id='blogger-loader'/>
<div style='display:none' id='HiddenPage' class='animate-bottom'> <script>
window.onload = function showPage() {
document.getElementById('blogger-loader').style.display = 'none';
document.getElementById('HiddenPage').style.display = 'block'; }
If you don’t want to loss the necessary attributes within <body> tag, put only onload='myFunctionLoader()' style='margin:0' as attributes.
If you save your HTML under theme it will show error that ending </div> not found before </body> tag.
Error parsing XML, line 3602, column 3: The element type "div" must be terminated by the matching end-tag "</div>".
Yes. You have to add </div> tag just before </body tag. You will get this <body> tag after scrolling down at the end of your HTML.
Put the following CSS on your Blogger HTML. To find available CSS space search for ]]></b:skin> and paste the copied CSS before it.
#blogger-loader { position: absolute; left: 50%; top: 50%; z-index: 1; width: 150px; height: 150px; margin: -75px 0 0 -75px; border: 16px solid #191919; border-radius: 50%; border-top: 16px solid #c33737; width: 120px; height: 120px; animation: spin 2s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }< .animate-bottom { position: relative; animation-name: animatebottom; animation-duration: 1s }
@keyframes animatebottom { from{ bottom:-100px; opacity:0 } to{ bottom:0; opacity:1 } }
#HiddenPage { display: none; }
STEP-3: Save your Blogger template and reload your blog. You can see the change you wanted to show visitors. This page loading preview will be shown on every loads, not only homepage loading.

Have got this article helpful or not working? Put your comment below.