JavaScript Library For Customizable Social Share Buttons – mkg-share

Category: Javascript , Social Media | April 27, 2016
Author: mkg0
Views Total: 2,719
Official Page: Go to website
Last Update: April 27, 2016
License: MIT

Preview:

JavaScript Library For Customizable Social Share Buttons – mkg-share

Description:

mkg-share is a pure JavaScript library that adds nice and highly customizable social share buttons to your webpage. Currently supports facebook, twitter, google plus, reddit, pinterest, linkedin, whatsapp (mobile device only), sms (mobile device only) and e-mail.

How to use it:

Download mkg-share and link to mkg-share.css & mkg-share.js.

<link rel="stylesheet" href="mkg-share.css">
<script src="mkg-share.js"></script>

Create a new mShare object to display default social share buttons on the webpage.

new mShare('#social-container');

Adjust the button sizes.

new mShare('#social-container',{size:'small'});

Use native social button styles.

new mShare('#social-container',{style:'native'});

Use custom data from html attributes.

<div data-mshare-url="http://google.com" 
     data-mshare-title="Custom Title" 
     data-mshare-description="Custom Content Description" 
     data-mshare-image="http://lorempixel.com/400/200">
     SHARE
</div>

All default options.

mode: 'expanded', //expanded, pane
style: 'basic', //basic,native
text: null, //null:auto, true, false
size: null, //null:normal, small
url: window.location.href,
title: this._defaultTitle(),
image: this._defaultImage(),
description: this._defaultDescription(),
language: 'en',
facebook: true,
facebookAppId: 677755208947007,
googleplus: true,
linkedin: true,
pinterest: true,
reddit: true,
twitter: true,
email: true,
whatsapp: true,
sms: true

You Might Be Interested In:


One thought on “JavaScript Library For Customizable Social Share Buttons – mkg-share

Leave a Reply