Simple JS library for create sharing buttons
MIT License
Share It — Simple JS library for create sharing buttons with counters. The JavaScript library is written without using JQuery or any other tools / frameworks.
How supported:
You can see online demo - https://distroid.github.io/share-it/
Add HTML code to your page
<div data-url="https://github.com/" class="share-it-buttons">
<div class="vkontakte"></div>
<div class="linkedin"></div>
<div class="facebook"></div>
<div class="twitter"></div>
<div class="google-plus"></div>
<div class="mailru"></div>
<div class="odnoklassniki"></div>
<div class="tumblr"></div>
<div data-media="https://code-bit.com/social.png" class="pinterest"></div>
</div>
You can init widget by two ways:
<HEAD>
with other scripts and for init widget use constructor.<script type="text/javascript">
new window.ShareIt()
</script>
Widget theme — Minimal color
For add parameters to widget need add attrubute data-<parameter>
Can be redefined for specific button
Parameter | Values | Description | Default |
---|---|---|---|
url |
string | Page url | window.location |
counters |
true | false | Use sharing counters | true |
window |
true | false | Open url in a popup | false |
titles |
true | false | Is add html attribute title="Share to <social>"
|
true |
description |
string | Page description | page title |
You can use attribute data-text="Button text"
for specific button for replace custom button text.
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
image |
string | Url to image |
noparse |
true | false | |
no_vk_links |
integer [0,1] |
See more in official documentation.
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
picture |
string | Url to image |
See more in official documentation.
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
See more in official documentation.
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
hashtags |
string | List of tags (example,demo) |
screen_name |
string | Address the Tweet to a specific user. |
via |
string | Attribute the source of a Tweet to a Twitter username |
related |
string | List of accounts related to the content of the shared URI. |
See more in official documentation.
Parameter | Values | Description |
---|---|---|
media |
string | Url to image (requred) |
description |
string | Post text |
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
image_url |
string | Url to image |
swfurl |
string | Url to Flash-movie |
width |
string | Video width |
height |
string | Video height |
See more in official documentation.
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
description |
string | Post text |
Parameter | Values | Description |
---|---|---|
url |
string | Page url for share |
title |
string | Post title |
See more in official documentation.
For compilation in root folder use command:
coffee --watch --compile --output lib/ src/
And for create min JS files:
gulp watch
Share-It is released under the MIT License.