0.0.1 • Published 8 years ago

data-share v0.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

Data Share

A simple way to share links. It just replaces your href and taget attributes. It depends on jQuery.

Support

  • Facebook data-share-facebook
  • Twitter data-share-twitter
  • Google Plus data-share-plus
  • Linkedin data-share-linkedin

Installation

npm install data-share

Usage

In your JS file, just require it:

require('data-share')
```

Then, in your HTML, use the `data-share-{media}` attribute.

```html
<a href="#" data-share-facebook>Share on facebook</a>
```

Through this attribute you can also pass options in JSON:

```html
<a href="#" data-share-linkedin='{"title": "Crazy title"}'>Share on Linkedin</a>
```

## Defaults

```javascript
var defaults = {
  url: window.location.href,
  target: '_blank',
  title: '',
  source: '',
  summary: ''
}
```