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.
Really Nice Trick.
ReplyDeletehttp://www.blogiri.com/
you have great work but some widget of your blog is similar to my blog
ReplyDeletelook like my blogger widgets
www.sainiblogger.blogspot.com
DeleteI 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..
ReplyDeleteI think This script unsupports Adsense banners so,It is better to remove this script from your blog.
DeleteI will try to find the solution soon and fix it:)
Mine works fine even with adsense.
DeleteMyPremiumTricks
Some Error in this Code Try To FiX it. There is symbol error . Fix and Tell me
ReplyDeletehttp://www.scriptjabbers.com/
Durai bro, I have sent you a guest mail on your email id. Kindly check it and let me know. :)
ReplyDeleteI will see it.Thanks for Sending:)
DeleteThank you rely done Great, It work Like charm
ReplyDeletei used this code in my template but not running. how to fix it. please help me. thanks a lot
ReplyDeleteCan you please tell me your blog url?
Deletehttp://blogonol.blogspot.com/
Deletethanks before for your help. happy blogging
its not working n my blog :(
ReplyDeletethanks a lot. this is run 100% in my blog.
ReplyDeleteThanks for saving live, it work like charm
ReplyDeleteThanks Buddy :-)
ReplyDeletenice one visit www.allworld.co.nr
ReplyDeleteThank you very much. It helped me alot.
ReplyDeletehttp://reviews-articles-blogs.blogspot.in/
its not working on my blog
ReplyDeletebrother its not working on my blog my blog is
ReplyDeleteKutebKhana.blogspot.com
This comment has been removed by the author.
ReplyDeleteWorking, 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.
ReplyDeletehttp://ultimatesqs.blogspot.in
You have done great job. keep it up!
ReplyDeleteAccess Platform
Very nice Tricks
ReplyDeletehttp://moonblogger4u.blogspot.com/
Nice Trick!
ReplyDeletehttp://lwthacking.blogspot.com/
Great post... thanks...
ReplyDeleteNice Trick I will try it on my Blog
ReplyDeletehttp://www.bedoitechsolutions.com/
ReplyDeleteAdded this to our list of valuable conversion resources. Will look forward to trying some of these experiments/tricks on our site! Thanks for sharing !
ReplyDeleteare you sure this code can make loading very fast????
ReplyDeleteHey Friend can you tell me di-marits of this Script if any. Other wise Nise Post.
ReplyDeleteOne more thing I am not able to denoted the speed of site is increase, its really increase or not :)
Blog of Blogger.com
dear admin this article is very useful for me thank you lot,amazingly best blogger tutorials
ReplyDeletebut 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)
Deletei 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
ReplyDeleteplease give some thing about prof blogging thank you admin please rpl me.
Nice one! Is is safe for SEO?
ReplyDeleteMy blog : http://funwithtricks.com
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.
ReplyDeleteit's work...nice post...
ReplyDeletevisit back...http://bukawww.blogspot.com/