🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Shares is a very small jQuery plugin for creating custom social links to share to a URL across several social media platforms: Facebook, Linkedin, Twitter and Google Plus.

social-share

Documentation

jQuery Shares

Installation

NPM

npm install jquery-shares --save-dev 

Webpack

require('jquery-shares');

jQuery

$(document).ready(function(){   $('a.share').shares(); });

HTML

On facebook, you should only share the url.

<a href="https://www.facebook.com" class="share facebook"><i class="fa fa-facebook"></i></a>

On Twitter, you should add the address url and attribute data-text.

<a href="https://www.twitter.com" data-text="The best thing that can be shared is knowledge." class="share twitter"><i class="fa fa-twitter"></i></a>

On Linkedin, you should add the address url and attribute data-text.

<a href="https://www.linkedin.com" data-text="The best thing that can be shared is knowledge." class="share linkedin"><i class="fa fa-linkedin"></i></a>

On GooglePlus, you should only share the url.

<a href="https://plus.google.com/" class="share google-plus"><i class="fa fa-google-plus"></i></a>

You May Also Like