• Home
  • About Me
  • Twitter Trends
  • YoutTube Trends
  • Google Trends
  • Age Calculator
  • Public Holidays
  • Fancy Fonts
  • Privacy Policy
  • Contact Me

iamrohit.in

My Public Notebook

Skip to content
Menu
  • Tools
    • Twitter Trends
    • Google Trends
    • Youtube Trends
    • YouTube Tags Generator
    • Age Calculator
    • Public Holidays
    • English to Hindi Typing
    • Business Name Generator
    • Word Finder
    • Fancy Text Generator
    • IP Location Finder
    • Hours Calculator
    • Date Time Calculator
    • Emoji Copy Paste
  • Free Submission
    • Business Listing Directories
    • Directory Submission Sites
    • Social Bookmarking Sites
    • Classified Sites
      • India
      • Australia
      • Canada
      • United Kingdom
      • United States
    • Article Submission Sites
    • Press Release Sites List
    • PDF / DOC / PPT Submission Sites
    • Web 2.0 Submission Sites
    • RSS Feed Submission Sites List
    • Search Engine Submission Sites List
    • Forum Submission Sites List
    • Profile Creation Sites
    • Pinging Submission Sites
    • Wiki Submission Sites List
    • Image Sharing Sites
    • Question and Answer Sites List
    • Video Submission Sites
    • PDF Submission Sites List
    • Document Sharing Sites
    • Profile Creation Sites List
    • Podcast Submission
  • jQuery Plugins
    • Accordion
    • Barcode
    • Calendar
    • Clock
    • Countdown
    • Character Count
    • ColorPicker
    • Data Grid
    • DatePicker
    • Date Time
    • EU Cookie Law
    • Fileuploader
    • Form Validation
    • Icon Picker
    • Image Slider
    • image Crop
    • Image Zoom
    • Inputmask
    • Loading
    • Mega Menu
    • Menu
    • Multiselect
    • Multi-Step Form
    • News Ticker
    • Notification
    • Photo Gallery
    • QR Code
    • TimePicker
    • Tooltip
  • HOSTING

Create your own social share buttons in JavaScript & HTML – sharer.js

by adminPosted onNovember 2, 2018

Sharer.js is a very tiny js lib to create custom social share components on DOM elements for your website. No dependencies. All the parameters can be passed via HTML5 data attributes.



Sharer.js currently supports more than 20 social media sites.

  • Twitter
  • Facebook
  • Linkedin
  • Google Plus
  • Email
  • Whatsapp
  • Telegram
  • Viber
  • Pinterest
  • Tumblr
  • Hackernews
  • Reddit
  • VK.com
  • Buffer
  • Xing
  • Line
  • Instapaper
  • Pocket
  • Digg
  • StumbleUpon
  • Flipboard
  • Weibo
  • Renren
  • Myspace
  • Blogger
  • Baidu
  • Ok.ru

Libraries

Load the sharer.min.js minified library.

<script src="sharer.min.js"></script>

<script src="sharer.min.js"></script>



HTML

Add the required CSS class ‘sharer’ to your element and create a custom Facebook, twitter etc buttons.

<button class="sharer"
        data-sharer="twitter" 
        data-url="http://iamrohit.in">
        Share on Twitter
</button>
 
<button class="sharer"
        data-sharer="facebook" 
        data-url="http://iamrohit.in">
        Share on Facebook
</button>

<button class="sharer" data-sharer="twitter" data-url="http://iamrohit.in"> Share on Twitter </button> <button class="sharer" data-sharer="facebook" data-url="http://iamrohit.in"> Share on Facebook </button>

Here are the list of data attribute you can use to customize your social share buttons.

  • data-width: width of popup
  • data-height: height of popup
  • data-title
  • data-url
  • data-via: for Twitter and Buffer
  • data-hashtags: for Twitter
  • data-to: for email
  • data-subject: for email
  • data-image: for Pinterest, Weibo, and VK
  • data-description: for Pinterest, Instapaper, Blogger, and Myspace
  • data-caption: for Tumblr and VK
  • data-tags: for Tumblr
  • data-picture: for Butter
  • data-appkey: for Weibo
  • data-ralateuid: for Weibo

See live demo and download source code.

DEMO | DOWNLOAD

This awesome plugin is developed by ellisonleao. Visit their official github repository for more information and follow for future updates.


Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Reddit (Opens in new window)

Related

Posted in Jquery & JavascriptTagged jquery social share plugins

Published by admin

View all posts by admin

Post navigation

Prev Draw Dynamic Lines Between Two Lists – jQuery FieldsLinker
Next Lightweight Angular directive to upload files – ng-file-upload

Subscribe to My Public NoteBook

Enter your email address to subscribe my public notebook and receive notifications of new posts by email.

Join 22,907 other subscribers

Categories

  • Angular.js
  • Bootstrap
  • CakePHP
  • CSS & CSS3
  • Express
  • Hosting
  • Interview Question and Answer
  • Jquery & Javascript
  • Kali Linux
  • Make Money Online
  • MYSQL
  • NodeJs
  • Offers & Deals
  • Others
  • PHP
  • ReactJs
  • Security Tips
  • SEO
  • Tailwind CSS
  • Tips & Tricks
  • Ubuntu
  • VueJs
  • WordPress
DigitalOcean Referral Badge

Advertisement

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
© Copyright 2023 – iamrohit.in
Allium Theme by TemplateLens ⋅ Powered by WordPress