About

Labels

slider

Recent

Navigation

Make your pages more social friendly with Sharer.js

All the social sites have different API to create their social icons, specially when we want custom icons. They are complex and hard to remember so what if we get easier way of accessing each of them with HTML5 data attributes. This pretty stuff is available for personal use only while commercial license need to be purchased from them.

Step 1: Install library

Add the library with script tag and put it in your head.
<script src='sharer.min.js' type='text/javascript'></script>

Step 2: Setup Markup

Each social site have their parameters of sharing a link. Some requires link only, while some of them requires title and description as well. To satisfy the needs of every link, there are different options for each of them. You can view a list here. I am going for twitter, because this is where most goes to.
See the Pen A demo for sharer.js by Mohammad Hamza Dhamiya (@hamzadhamiya) on CodePen.
With the above demo, you must have know that no need to initialize the library, just add sharer class to each sharing button.

Why to use it?

  • Easy to use
  • Small and fast
  • Supports 20+ social media sites
  • Support of Viber and Whatsapp are really new things for me right now.
  • Best one: no dependencies
Share
Banner

Muhammad Hamza

Themelet provides the best in market today. We work hard to make the clean, modern and SEO friendly blogger templates.

Post A Comment:

0 comments: