Make your blog faster with lazy Image loading script

when blog loads slow
Don’t you hate it when websites load slowly? I know I do. And to make matters worse, do you even come back to websites that load slow? The chances are, you don’t!.There are many factors But Images are one of the important factor that affects blog load time.So,To reduce blog Images load time today I have brought lazy image loading plugin for blogger!

Lazy Load is a jQuery plugin which only loads Images seeable in the viewport (visible part of web page) thereby enhancing the Page Load time. The images which are out the initial visible region of the screen are loaded as the users scrolls through them. A really useful plugin for Image intensive Blog's.This widget really decrease the 50% of blogs load time as you check your own blog with Gtmetrics.Lets see the working of this plugin

How to install this plugin to blogger?

  • Login to Blogger > Dashboard
  • Click on Drop Down Menu and select Template
  • Backup your Template before making any changes to your blog
  • Now Click on Edit HTML > Proceed
  • Press Ctrl + F and search the code shown below. 
</head>
Copy below codes and paste above </head>

<script type='text/javascript'>//<![CDATA[
(function(a){a.fn.lazyload=function(b){var c={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(b){a.extend(c,b)}var d=this;if("scroll"==c.event){a(c.container).bind("scroll",function(b){var e=0;d.each(function(){if(a.abovethetop(this,c)||a.leftofbegin(this,c)){}else if(!a.belowthefold(this,c)&&!a.rightoffold(this,c)){a(this).trigger("appear")}else{if(e++>c.failurelimit){return false}}});var f=a.grep(d,function(a){return!a.loaded});d=a(f)})}this.each(function(){var b=this;if(undefined==a(b).attr("original")){a(b).attr("original",a(b).attr("src"))}if("scroll"!=c.event||undefined==a(b).attr("src")||c.placeholder==a(b).attr("src")||a.abovethetop(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.rightoffold(b,c)){if(c.placeholder){a(b).attr("src",c.placeholder)}else{a(b).removeAttr("src")}b.loaded=false}else{b.loaded=true}a(b).one("appear",function(){if(!this.loaded){a("<img />").bind("load",function(){a(b).hide().attr("src",a(b).attr("original"))[c.effect](c.effectspeed);b.loaded=true}).attr("src",a(b).attr("original"))}});if("scroll"!=c.event){a(b).bind(c.event,function(c){if(!b.loaded){a(b).trigger("appear")}})}});a(c.container).trigger(c.event);return this};a.belowthefold=function(b,c){if(c.container===undefined||c.container===window){var d=a(window).height()+a(window).scrollTop()}else{var d=a(c.container).offset().top+a(c.container).height()}return d<=a(b).offset().top-c.threshold};a.rightoffold=function(b,c){if(c.container===undefined||c.container===window){var d=a(window).width()+a(window).scrollLeft()}else{var d=a(c.container).offset().left+a(c.container).width()}return d<=a(b).offset().left-c.threshold};a.abovethetop=function(b,c){if(c.container===undefined||c.container===window){var d=a(window).scrollTop()}else{var d=a(c.container).offset().top}return d>=a(b).offset().top+c.threshold+a(b).height()};a.leftofbegin=function(b,c){if(c.container===undefined||c.container===window){var d=a(window).scrollLeft()}else{var d=a(c.container).offset().left}return d>=a(b).offset().left+c.threshold+a(b).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);$(function(){$("img").lazyload({placeholder:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib783M6_WT3G8VgJZPdAAYSsAVq7zC13iCYKZl8Mn1JyGApb3CY8-2D_k3k-cMZFoBULrFxfIMZjotA57B_wP_Hzr5tbMWW-tY_si7_t1CxSDkUJDqnj_3A3u4yHRiYz9dVqHofScKQ30/s1600/truebloggertricks.blogspot.com.gif",effect:"fadeIn",threshold:"-50"})})//]]></script>

  • Now just press on save template and refresh your blog.  
  • Now just scroll your blog and see your images fade in with lazy loading effect.
If you have any Doubts regarding this post, Please ask it via comments and Dont forget to share this post with your friends!!

39 comments:

  1. Really Nice Trick.
    http://www.blogiri.com/

    ReplyDelete
  2. you have great work but some widget of your blog is similar to my blog

    look like my blogger widgets

    ReplyDelete
  3. I added this code to my blog Free Android App Shop.com... But after placing this code my adsense ads not showing up.. So I just removed this code from my template.. please fix..

    ReplyDelete
    Replies
    1. I think This script unsupports Adsense banners so,It is better to remove this script from your blog.

      I will try to find the solution soon and fix it:)

      Delete
  4. Some Error in this Code Try To FiX it. There is symbol error . Fix and Tell me
    http://www.scriptjabbers.com/

    ReplyDelete
  5. Durai bro, I have sent you a guest mail on your email id. Kindly check it and let me know. :)

    ReplyDelete
  6. Thank you rely done Great, It work Like charm

    ReplyDelete
  7. i used this code in my template but not running. how to fix it. please help me. thanks a lot

    ReplyDelete
    Replies
    1. Can you please tell me your blog url?

      Delete
    2. http://blogonol.blogspot.com/
      thanks before for your help. happy blogging

      Delete
  8. thanks a lot. this is run 100% in my blog.

    ReplyDelete
  9. Thanks for saving live, it work like charm

    ReplyDelete
  10. nice one visit www.allworld.co.nr

    ReplyDelete
  11. Thank you very much. It helped me alot.
    http://reviews-articles-blogs.blogspot.in/

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Working, superb, but i have a question, this script opens images in the lower part of blog only when the user scrolls down is this right? I have ads on the lower part of my blog also, so suppose if the user doesnt scroll down then those ads wont open? because i get paid CPM so i dont want to loos out on that. is this correct or i am missing something, Plz reply... thanks.

    http://ultimatesqs.blogspot.in

    ReplyDelete
  14. Very nice Tricks
    http://moonblogger4u.blogspot.com/

    ReplyDelete
  15. Nice Trick!
    http://lwthacking.blogspot.com/

    ReplyDelete
  16. http://www.bedoitechsolutions.com/

    ReplyDelete
  17. Added this to our list of valuable conversion resources. Will look forward to trying some of these experiments/tricks on our site! Thanks for sharing !

    ReplyDelete
  18. are you sure this code can make loading very fast????

    ReplyDelete
  19. Hey Friend can you tell me di-marits of this Script if any. Other wise Nise Post.
    One more thing I am not able to denoted the speed of site is increase, its really increase or not :)
    Blog of Blogger.com

    ReplyDelete
  20. dear admin this article is very useful for me thank you lot,amazingly best blogger tutorials

    ReplyDelete
    Replies
    1. but one thing just i cant understood without trying your message those people or bloggers asking you, really is it work or not? this is not good respect for a blogger guide (admin)

      Delete
  21. i want to lear more about bloggs, just now i have involved blogging.really i dont knew even what is a blogg?the word i knew just five or six month back,i am a professional pharmacist practising in my own drug store so i want say something about medicament and first aid ,diseases and so on
    please give some thing about prof blogging thank you admin please rpl me.

    ReplyDelete
  22. Nice one! Is is safe for SEO?

    My blog : http://funwithtricks.com

    ReplyDelete
  23. Really a nice article. I bookmark it. Keep it up.Visit also to my site to get more tips on how to fast your site.

    ReplyDelete
  24. it's work...nice post...

    visit back...http://bukawww.blogspot.com/

    ReplyDelete

Please don't spam. We hate spammers