Easy jQuery Social Content Locking Plugin - shareIt.js

File Size: 50.5 KB
Views Total: 4575
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Easy jQuery Social Content Locking Plugin - shareIt.js

shareIt.js is a simple to use jQuery plugin used to lock / hide the specified content (e.g. download links) until the visitor shares, likes or tweets your webpage. It is useful to help you get more social followers, likes and shares from your audiences.

Social Networks supported:

  • Facebook share.
  • Facebook like.
  • Twitter follow.
  • Twitter tweet.
  • LinkedIn share.
  • Google Plus +1.

Basic usage:

1. Load the CSS file shareIt.css in the head section of your web page.

<link href="/path/to/shareIt.css" rel="stylesheet">

2. Load jQuery library and the JavaScript file shareIt.js at the bottom of the web page.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="/path/to/shareIt.js"></script>

3. Config the social network services.

var options = {

    facebook:{
        url: "URL to share",
        pageId: "Facebook Page ID",
        appId: "Facebook App ID"
    },
    twitter:{
        via: 'Twitter Username',
        url: "URL to share",
        text: document.title
    },
    googleplus:{
        apikey: 'Google Api Key',
        url: "URL to share"
    },
    linkedIn:{
        url: "URL to share"
    },

    buttons:["facebook_share","facebook_like","twitter_tweet","twitter_follow","googleplus","linkedin"]

};

4. Call the function on the desired content you want to lock.

$(".lock").shareIt(options);

5. All default options.

title: "Share/Like/Follow to Download",
rand: Math.floor((Math.random() * 1000) + 1),
text: 'Choose Any Social Social Network from below to share our content and Download it.',
buttons: ["facebook_like","facebook_share","twitter_follow","twitter_tweet","googleplus","linkedin"],
linkedIn: {
 url: window.location.href
},
facebook:{
  appId: 676027382527018,
  pageId: 'MyCodingTricks',
  url: window.location.href
},
twitter:{
  via: 'mycodingtricks',
  url: window.location.href,
  text: document.title
},
googleplus:{
  apikey: 'AIzaSyD_H_TgxVsG0jMy6dMTKjkhHilxIk_bQBk',
  url: window.location.href
},
count:{
  twitter:{
      tweets:0,
      follower:rand
  },
  facebook:{
      likes:0,
      share:0
  },
  googleplus:{
      circledByCount: 0
  },
  linkedIn:{
      shares:0
  }
},
feedback:{
  url: "http://mycodingtricks.com"
}

About Author:

Author: Shubham Kumar

Website: http://mycodingtricks.com/jquery/shareit-js-social-content-unlocker/


This awesome jQuery plugin is developed by mycodingtricks. For more Advanced Usages, please check the demo page or visit the official website.