ContentShare is a jQuery plugin which lets you share the exact content on a page which you actually want to share. It enables you to share selected text on your social network rather the default text specified in the <meta> tags. By default, it supports Facebook and Twitter but you can add more networks easily.
ContentShare by default works on the text within <p> tags. So, if you are okay with this then you can skip this part.
To customize, you can specify any element via CSS/jQuery Selectors and pass it while calling the plugin like:
// calling the plugin on DOM ready
$(document).ready(function(){
$("p").contentshare();
$.fn.contentshare.defaults.shareable.on('mouseup',function(){
$.fn.contentshare.showTooltip();
});
});
NOTE: The above code can be found at the end of contentshare.js file. You can do your modifications in the highlighted line (Line No.3)
Options
Variable
Description
Default Value
Valid Values
shareIcons
Array of Links to the Icons which appear in the Tooltip
["img/fb.png","img/tw.png"]
Array of Links, the links can be absolute or relative
shareLinks
Array of Share Links belonging to different Social Networks
See Facebook's Sharer or Feed Dialog and Twitter's Intent
See Facebook's Sharer or Feed Dialog and Twitter's Intent
minLength
Minimum number of characters to be selected for this plugin to work
5
Any Number
newTab
Clicking on any one of the social links opens in a new tab
true
Either trueor false
className
The name of the class which is used by the plugin
contentshare
Any String which obeys W3 Standards for class names