jQuery Plugin To Tweet Quotes From Your Articles - Tweetthis.js

jQuery Plugin To Tweet Quotes From Your Articles - Tweetthis.js
File Size: 4.17 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Yet another Twitter sharing plugin for jQuery (less than 1kb) that automatically generates Twitter share links to tweet/share pieces of text within your article.

How to use it:

1. Load both jQuery library and the jQuery Tweetthis.js script in the webpage.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="tweetthis.js"></script>

2. Load the Font Awesome iconic font for the Twitter share icon (OPTIONAL).

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

3. Just wrap the Quotes you want to share inside an element with the CSS class of 'tweetthis' and done.

<span class="tweetthis">Text To Share</span>

4. Customize the Twitter share link.

var newHtml = $("<a class='btn btn-tweetthis' target='_blank'></a>")
    .attr('href', "https://twitter.com/intent/tweet?text=" + text)
    .html("<span class='fa fa-twitter'></span> Tweet This");

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