GithubHelp home page GithubHelp logo

ed-ma / simple-share Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arizzitano/simple-share

0.0 1.0 0.0 303 KB

Easily create customizable social share buttons without loading any external resources.

License: Other

simple-share's Introduction

simple-share

Easily create customizable social share buttons without loading any external resources. Instead of dragging in iframes, this plugin uses just the naked share URL for each social sharing service's API. Plus, rather than using images, it uses an icon font generated with Icomoon, so they're easy to style.

Supported Services

Currently, simple-share supports sharing via:

  • Facebook
  • Twitter
  • LinkedIn
  • Google+
  • Pinterest
  • Stumbleupon
  • Reddit
  • Tumblr
  • Email
  • More to come

How it works

simple-share launches each social sharing link in a popup window, similar to the way the services' native buttons work. If desired, it will also add the appropriate icons to these links.

Here's an extremely basic usage of simple-share. Take a look at this markup:

<p class="simple-share">
    <a data-service="facebook">facebook</a>
    <a data-service="twitter">twitter</a>
    <a data-service="google-plus">google-plus</a>
    <a data-service="linkedin">linkedin</a>
    <a data-service="stumbleupon">stumbleupon</a>
    <a data-service="reddit">reddit</a>
    <a data-service="tumblr">tumblr</a>
</p>

Any link that you want to work like a share button should have a data-service attribute containing the name of the service. google-plus is hyphenated; all others are just one word.

Here's the JS function call:

$(document).ready(function() {
	 $('.simple-share a').simpleShare();
});

Options

simple-share takes a hash of options, if desired.

Option Type Default What it does
icons boolean true Prefaces each social service link with the appropriate icon.
shape string 'square' Determines which shape icons are used. Options are 'square', 'circle', or 'none' (just the icon with no containing shape)
color boolean true Whether or not to style icons with the services' official colors.

simple-share's People

Contributors

arizzitano avatar danieleli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.