How To Lazy Load Social Share Buttons Like TechCrunch Does

Learn Web Design, Coding & much More! 100% Off First Month.

Social share buttons normally increase the website loading time and cause the document rendering to hang while waiting for the social share buttons to load. Almost 90% of websites and blog don’t really care about the extra loading time caused by these independent social share buttons. To get rid of this, Socialite.js – a 2KB or less (when minified and compressed) javascript adds various techniques to lazy load the social share buttons only when its needed.

A perfect example is how the way TechCrunch handles the social share buttons. If you’r looking for something like that, then here comes the method to achieve that.

lazy load social share buttons

How to Setup?

Step 1: Add socialite.js to header

Step 2: Socialite.js was programmed to easily customize and configure the script, with a little bit of CSS work you will get the desired output. However beginners are recommended to use the Socialite’s CSS to get a better understanding on how it works.

Socialite supports – Facebook, Twitter, Google Plus, Linked-in, Pinterest and Spotify. For an example lets take Twitter. Here “socialite” is the main class and “twitter” is to specify the social network. For Facebook simple replace “facebook” instead of “twitter”.

<a class="socialite twitter" href="http://twitter.com/share" data-url="http://www.yourdomainname.com">
    Share on Twitter
</a>

More details about the setup is available here https://github.com/dbushell/Socialite/blob/master/README.md

Some more concept demos:

Socialite is also available as WordPress plugin. Check it out here

May 23, 2012. This entry was posted in Web Resources. Bookmark the permalink.

We Recommend HostGator Hosting

Bloggermint strongly recommends Hostgator Hosting for all of your web hosting needs. Sign up today for WordPress Hosting at just $4.95/month.

Use coupon code "bloggermint" to get 25% discount on any hosting packages. Get an account with Hostgator now!

6 Responses so far!

  1. That will be great ! and if you write a post on how to install social buttons without plugin.[ i have the codes] but align it with proper css or decoration will be great ! and floating. cause some plugins take so much time to load ! :D

  2. Brilliant post, thanks so much! Will definitely use this on my websites.

  3. Thanks :)

    do that plugin works fine? I am gonna try that.

  4. Amazing post.. gonna use it soon.. :)

  5. Thanks for the trick..Lazy loading has actually increased my blog’s load speed. Previously my theme was using all JS files on header to load social share icons. Now no more..

  6. great article, i interested floating style in left side of your blog, can you tell me about it?.
    It’s plugin or your custom.

    thanks,
    imooh

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>