You've probably seen "ajax-style" loading icons before. These small animations appear on web-pages while page elements are loading, and disappear (or are replaced by content) when the page has fully loaded.
Inspired by the page loading feature I noticed in Meta-Microcosmos, I decided to find out how to add an animated ajax-style loading icon to Blogger templates.
After a little trial and error, I discovered a solution which is cross-browser compatible and can be added to your template in one easy step. So in this tutorial, I'll explain how you can add an ajax-style page loading icon to appear in the top corner of your Blogger template which disappears once the page has loaded.
The loading icon used for this tutorial is the same as that which appears in the top-right hand corner of this blog when you load the page:

This small, unobtrusive image has a minimal file size, and is easy on the eyes so it doesn't detract from other style elements of the page.
Of course, if you would prefer to use a different icon, you can change the URL of the image in the code used for this hack as I will explain shortly.
Adding the Loading Icon to your Template
Adding this page loading icon is as simple as copying and pasting a section of code!
Simply go to Layout>Edit HTML in your Blogger dashboard, and find the opening <body> tag.
Then replace this tag with the following section of code (copy to your clipboard, then paste this in place of the <body> tag):
<body onLoad='init()'>
<span id='loading' style='position:absolute; text-align: center; top:10px; right: 10px;'><img border='0' src='http://bloggerbuster.com/images/loading.gif'/></span>
<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>
You can then preview your blog to see the page loading icon appear in the top right-hand corner of your blog template momentarily until the page has loaded.
Providing there were no errors received when you previewed the page, you can then proceed to save your template.
That was easy, wasn't it?
Changing the Animated Icon
Of course, some of you may prefer to use a different animation to the one featured here.
Any animated GIF image may be used as a page loading icon, and all you have to do to alter the image is change the URL in this line of the script to match the location of your preferred image instead:
<span id='loading' style='position:absolute; text-align:center; top:10px; right: 10px;'><img border='0' src='http://image-host.com/your-loading-image.gif'/></span>
Ajaxload is a really useful resource for generating your own color styles of image loading icons. Alternatively you can find a great selection over at Sanbaldo.com
Adding text to the loading icon
You can even add an explataroty "loading..." message to your icon by adding this just before the icons image tags, like this:
<span id='loading' style='position:absolute; text-align:center; top:10px; right: 10px;'>Loading...<img border='0' src='http://image-host.com/your-loading-image.gif'/></span>
A little info about this script
I had originally experimented with the script used in Meta-Microcosmos to feature the loading icon which is housed in the <head> section of the template.
However, this caused some problems when viewed in IE6 as this caused the icon to appear above the template, rather than in the corner (it occasionally caused the page to freeze too!).
So instead I adopted this version which uses the body onload function to cause the script to take action. This ensured that the icon appeared correctly in all browsers I have tested in, including IE6 and 7, Firefox and Flock.
If you notice any problems in other web browsers, please let me know about this!
Also you may have noticed the need to "escape" certain HTML characters within the script itself. This is because Blogger parses JavaScript differently when it is featured in the body (rather than the head) section of the template. However, when you look at the source code of your template, you will see the original script coded correctly.
Final Thoughts
While this Blogger hack may be mostly cosmetic, it is a fun and interesting feature which can add style and personality to your template design.
I hope this article has been useful for you! If you have enjoyed this tutorial, please consider subscribing to Blogger Buster for future tutorials and Blogger news.





You´re so right, Amanda! I always forget IE6 :$
ReplyDeleteIn LoadInfo you can also generate personalized loading icons, but I like butterflies...
very useful tip!!!!!
ReplyDeletethanks!
i want to ask you, about a wordpress like pagination in blogger...is that posible?
ReplyDeletethanks!
For Yo Misma:
ReplyDeleteLoad Info is a really useful resource! Thank you for the link!
For Vassileios:
As yet, the pagination is very difficult to implement in Blogger blogs. I have made a few unsuccessful attempts at this so far, but as soon as I can find a working solution I will be sure to post this here!
Thank you both for your comments!
Thank u..thank u...thank u..amanda.
ReplyDeletei love u.
by the way how about ur 2 little monster. Still little or becoming giant monster???lol
oops...in IE7, it is loading all the time. i tried to reload IE7 couple of times but still loading continuously.
ReplyDeletehow can i solve this prob..amanda
also like to mention that in my country most of the reader use IE7.so it's annoying both for me and them that it's loading all the time.:(((
Very useful!! Thanks again.
ReplyDeletewow amanda...you are super cool...thanks a lot...love it.... :)
ReplyDeleteYour template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
ReplyDeleteXML error message: The element type "body" must be terminated by the matching end-tag "".
help...
Very Cool!!
ReplyDelete**Using it**
Please, have a look on www.barriodebenalua.es (corner up-left), I put your useful loading code with my own gif, and it´s showing always behind the header banner. How can I put it on the front??
ReplyDeleteThank you very much for your useful blog!!!
how to i center it?
ReplyDeleteThanx! You can create your own loading icons here (http://www.ajaxload.info). :)
ReplyDeletehow to change loading position nearly pointer.. but thx it's work for me..
ReplyDeletegreate!
ReplyDeleteHey Amanda, it's a great add-on! But I have a tabber by barelyfitz and it's not working. The tabber doesnt load along with another scripts... Do you know how to fix this problem? Thanks!! :D
ReplyDeleteThanx so much cute Amanda :)
ReplyDeletevery nice tip
Thank Amanda. Sending you kiss for this trick.
ReplyDeleteAnyway, is there a way to show this widget in the centre and in the front of template?
I tried to mess a little with the code, but I was and able to convince the image to stay on top of a template.
Any advice?
great .. it actually works.
ReplyDeletewhat if you wanted it to appear in the centre and hide the page untill it loads? like a loading screen?
style is ajax but can we use ajax for opening the blog posts...???
ReplyDeleteProBogBooster.com
thank you so much...
ReplyDeleteit's very nice tip
I still learn how embed this code on my blog, your code some not well formed on my html template. can I modified this code amanda?
ReplyDeletesex
ReplyDeleteporn
free porn
porn
free sex
free sex
porno
escort bayan
Thank you very much for the extensive explanation.
ReplyDeleteTravesti,
ReplyDeleteEscort Bayan,
Travesti,
Escort Bayan,
Adana Escort Bayan,Ankara Escort Bayan,
Antalya Escort Bayan,istanbul anadolu yakası Escort Bayan,
istanbul avrupa yakası Escort Bayan,
Bursa Escort Bayan,
tekirdağ Escort Bayan,
Kayseri Escort Bayan,
izmir Escort Bayan,
mersin Escort Bayan
ankara Escort Bayan,
istanbul anadolu yakası Escort Bayan
Escort Bayan Forum,
İstanbul Travestileri,
Escort Bayan,
Travesti,
Escort Bayan Ankara,
Escort Bayan İstanbul,
thank you so much, you're a great help.
ReplyDeletecan you help me fix slow loading of my blog? it takes 22 seconds before it starts displaying content.
ReplyDeletehere's the url http://directionsonweb.blogspot.com/
thank you so much.
Reverse Cell Phone Lookup | Landscape Lighting | Pellet Stoves | Outdoor Security Lights | Used Pellet Stoves | Lookup a Cell Phone Call | Outdoor Flood Lights | Discount Pellet Stoves
ReplyDeleteThese are some detailed steps. Thanks for sharing these. Appreciate it!
ReplyDeleteNice information,Ankara escort
ReplyDeletemany thanks to the author.Ankara escort
It is incomprehensible to me nowAnkara escort
, but in general,Escort ankara bayan
the usefulness and significance is overwhelming.Ankara escort
Thanks again and good luck!
Ankara escort
became the first designer in Wimbledon's 133-year history to create official uniforms for the tournamentescort bayan ankara
As part of this year's event, which starts next week.
will introduces the first ...Escort ankara
determinationEscort ankara
to maintain and enhance the values for which our two brands are famous throughout the world.Escort ankara
The rugby ralph lauren brand brings to Wimbledon the look of timeless elegance,Escort ankara
drawing on our rich history and traditionsEscort ankara
expert and i like your blog and the information you have
mentioned in this post about the Google tools is really great!
escort bayan
escort bayan ankara
escort bayan ankara
escort bayan ankara kızılay
Escort ankara bayan
escort bayan ankara çankaya
Ankara escort bayan
Ankara escort bayan
Ankara Escort
Thanks for sharing. Very impressive
Ankara Escort,
ReplyDeleteEscort Ankara,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Bayan Ankara,
Ankara Escort,
ReplyDeleteAnkara Escort,
Ankara Escort,
Ankara Escort,
Escort Ankara,
Escort Ankara,
Escort Ankara,
Escort Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Bayan Ankara,
the blog is interesting! thanks for sharing this useful info
ReplyDeleteLondon Crumpet has a message board where London escorts and agencies can post their messages about their services or announce people about any update of their profile. Visitors can also rate the escorts on Hot or Not gallery and give some credentials to the escorts they like.
ReplyDeleteLondon Asian Escorts is an Asian and Oriental escort agency operating in Central London. The agency provides escort service for a true gentlemen.
ReplyDeleteHi, Thank you write.
ReplyDeleteto share is Escort Bayan Ankara thank you share.
good site admin
Escort Ankara
Escort Ankara
Escort Ankara
Ankara Escort
Ankara Escort
Ankara Escort
Escort Bayan Ankara
Escort Bayan Ankara
Escort Bayan Ankara
Bayan Escort
Escort Bayan
Escort Bayan
Bayan Escort
Escort Bayan
Bayan Escort
Escort İstanbul
İstanbul Escort