Social Buttons Asynchronous Loading with Socialite.js

1

Socialite provides a very easy way to implement and activate a plethora of social sharing buttons - any time you wish. On document load, on article hover, on any event!

If you're selling your soul, you may as well do it asynchronously. Socialite won't cause document rendering to hang while waiting for 500kb of social media.

Major Social Sharing Buttons. Asynchronous Loading with Socialite.js

Features and Benefits

  • No dependencies to use.
  • Loads external resources only when requested.
  • Less than 2kb when minified and compressed.
  • More accessible and styleable defaults/fallbacks.
  • Support for Twitter, Google+, Facebook, LinkedIn, Pinterest, and Spotify
  • Extensible with other social networks.
  • Mimics native implementation when activated.
  • Supported in all browsers (providing the buttons are).

How to Setup

Create an element with the class socialite and a class like twitter to specify the social network. Best practice is to provide an accessible fallback URL like the example below. You can style it however you like!

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

Use data-* attributes to configure your button. These configurations directly correlate to the individual network implementations, so while Twitter uses data-url, Facebook uses data-href. Not ideal but I'd rather keep this script very small!

View Demo Socialite.js
Free Download Socialite.js

1 COMMENT

Leave a Reply to Keratina Cancel reply

Please enter your comment!
Please enter your name here