Skip to content

davidmars/data-social-share-click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

data-social-share-click

Share current page url across social networks. No more.

No icons, no CSS, no UI, no effects, no dependencies.

Install

Node

npm install data-social-share-click --save

Usage

Javascript

import DataSocialShareClick from "data-social-share-click";
let socialShares=new DataSocialShareClick();
socialShares.listenClicks();

Html

<button data-social-share-click="facebook">Facebook</button>
<button data-social-share-click="twitter">Twittet</button>
<button data-social-share-click="googlePlus">G+</button>
<a href="#" data-social-share-click="linkedIn">LinkedIn</button>

What does it do?

When the script is included, it listens for click events on document. When a click occurs on element with data-social-share-click="facebook" attribute, it will open a Facebook share popin to share the current browser's url.

About

Share current page url accross social networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published