Minimalist jQuery Tweetable Text Plugin - Tweet Highlighted

Minimalist jQuery Tweetable Text Plugin - Tweet Highlighted
File Size: 52.6 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Tweet Highlighted is a dead simple yet useful jQuery plugin that makes all the text content of your page tweetable to encourage your readers to spread your content through twitter.

See also:

How to use it:

1. Include the latest jQuery javascript library and jQuery tweet highlighted plugin in the page.

<script src="jquery.min.js"></script>
<script src="jquery.tweetHighlighted.js"></script>

2. Call the plugin with iptions..

$('body').tweetHighlighted({

  // minimum text length to show the tweet button for
  minLength: 6,

  // max text length to show the tweet button for
  maxLength: 300,

  // class name to use for the node
  cssClass: 'btn tweet-me',

  // twitter handle to use as 'via'
  via: 'jqueryscript',

  // any extra stuff to add to the tweet text (mostly links)
  extra: '-- jQueryScript',

  // arguments to pass to the window.open() function
  popupArgs: 'width=400,height=400,toolbar=0,location=0',

  // callback function to pass text to when a user takes action
  callback: null

});

3. The plugin will create a button element attached to the selected text. You can style the button with the class name 'tweet-me' via CSS.

<button type="button" class="btn tweet-me">Tweet</button>

Change logs:

2015-07-11

  • Added a callback option

2013-12-03

  • replace the default share button with a beautiful twitter button.

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