Giter Club home page Giter Club logo

hideshare's Introduction

HIDESHARE

jQuery plugin for inserting social sharing functionality. Requires that Font-Awesome fonts and CSS be installed.

GitHub page found at http://arnonate.github.io/hideshare/

Demo

A demo can be found at http://natearnold.me/hideshare/example/

Getting Started

Font-Awesome (http://fortawesome.github.io/Font-Awesome/) is used in the example but not required for the plugin to function. To use text links simply delete the line of CSS that sets .hideshare-wrap span to display none.

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="hideshare.min.js"></script>
<script>
jQuery(function($) {
  $(".share").hideshare(); // Calls HIDESHARE on element with class "share"
});
</script>

Examples

A simple usage case would involve calling HIDESHARE on a button like in the following example:

<img src="http://farm7.staticflickr.com/6213/6243090894_8b8dd862cd.jpg">
<a class="share" href="#">SHARE ME</a>

<script>
$(document).ready(function() {
  $(".share").hideshare({
    media: "http://farm7.staticflickr.com/6213/6243090894_8b8dd862cd.jpg"
  });
});
</script>

Options

The following options may be configured:

<img src="http://farm7.staticflickr.com/6213/6243090894_8b8dd862cd.jpg">
<a class="share" href="#">SHARE ME</a>

<script>
$(document).ready(function() {
  $(".share").hideshare({
    link: "",           // Link to URL defaults to document.URL
    title: "",          // Title for social post defaults to document.title
    media: "",          // Link to image file defaults to null
    facebook: true,     // Turns on Facebook sharing
    twitter: true,      // Turns on Twitter sharing
    pinterest: true,    // Turns on Pinterest sharing
    googleplus: true,   // Turns on Google Plus sharing
    linkedin: true,     // Turns on LinkedIn sharing
    position: "bottom", // Options: Top, Bottom, Left, Right
    speed: 50           // Speed of transition
  });
});
</script>

Styles

The following styles are necessary for display:

<style>
.hideshare-wrap {
  position: relative;
}
.hideshare-list {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
.hideshare-list li {
  display: inline-block;
  zoom: 1;
  *display: inline;
  margin: 2em 1em;
}
.hideshare-wrap span {
  display: none;
}
</style>

hideshare's People

Contributors

arnonate avatar

Watchers

 avatar  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.