October 25, 2020

Add jQuery Lazy Load in Blogger to Boost Your Blog Speeed

Advertisements


 


Follow these steps to increase your Blogger Website Speedup with Image Lazy Loading Script


Yow Can see the instant effect after implementing this jQuery Code in Your Template.

1. Go to your www.blogger.com 

2. Select your blog in which you want to fix a value for the name field is required 


3. Click on Theme from Left Menu.
4. Click on Arrow my theme like bellow.


5. Click on Backup/Restore your template before doing any Changes.
6. Click on Arrow my theme on Again and click to Edit HTML.
7. Click Anywhere on the Code and then press Ctrl + F . Now Type </body> in Search Box.


7. Now Above the  </body> tag, Paste the Below code.

<script type='text/javascript'>
// Jquery LazyLoad Script by www.Bloggersstand.com
//<![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/AVvXsEjSKfwwIpllfnB_4tNX0ybmWi-O23rEAg2237nuuVfAeHZAR54o_cFsByfaLjcckwJxVycIIAK0XBppl3YYQpaJhVgGC4KuDtsKDmJJfDeky6Lv70092p5By4_L0NNF2HAKTTpCP5Kh-Q4/s1600/bloggersstand.gif",effect:"fadeIn",threshold:"-50"})});//]]></script>


 8. Save The Template.

Now Check you blog speed and see the effect.





Share This Post To Social Network





0 Comments:

Post a Comment