The most annoying thing in most of the blogs I feel is the loading time. I hate sitting and waiting for all images to load and I can start view properly. It looks like we have only few images to load and icons on our page. But the fact is there are so many images in our template , specially in hacked templates. Sometimes it happens growing our blog also increases the loading time.
You must have read so many articles to reduce loading time of blog . Anyone of them worthy? May be Or you have seen some blogs or sites which use to load their images only when they are required. Sounds intelligent. Isn’t it? Here I am sharing with you the secret for this. A small piece of code can help you here.
The name is Lazy Load Plugin .
This script will load images only which is displayed onto the present screen. Scrolling further will load the other images as well.
Get it now !
Just copy the code below and paste in your header section or find </head> tag in your template and paste above it.
<script charset=’utf-8′ src=’http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js’ type=’text/javascript’/><script src=’http://bnote.googlecode.com/files/jquery.lazyload.js’ type=’text/javascript’/>
<script charset=’utf-8′ type=’text/javascript’>
$(function() { $("img").lazyload({placeholder : "http://bnote.googlecode.com/files/grey.gif",threshold : 200});});
</script>
It might take a little to work as programmer are working with it for better performance with all the latest browsers.