Post Highlighted Text on Twitter

January 04, 2020 No comments jQuery Twitter Highlight

1. Introduction

TweetHighlighted is a jQuery plugin that allows website users to post selected on the website text to the Twitter.

Highlight text to tweet it

2. Plugin Overview

Library TweetHighlighted
Author Waldo Broodryk
Licence MIT Licence
Repository CodePen
Dependencies jQuery 1.3.1 or Latest version,
jQuery UI ,
Bootstrap 4.1.3
and Font Awesome 4

Demo

3. How to install and use TweetHighlighted jQuery plugin

Follow the below steps in order to install TweetHighlighted jQuery plugin on your website.

1. Include jQuery and load TweetHighlighted and Webflow JavaScript files:

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

<!-- webflow Js -->
<script src="js/webflow.js"></script>

<!-- Tweet Highlighted Js -->
<script src="js/jquery-tweet-highlighted.js"></script>

2. Initialize TweetHighlighted plugin:

$('body').tweetHighlighted({                 
  node: '<a href="#" class="w-button tweet">Tweet</a>',
  minLength: 6,
  maxLength: 240 * 2,
  extra: 'https://frontbackend.com',
  via: 'frontbackend',
  popupArgs: 'width=600,height=600,toolbar=0,location=0'
});

That's pretty much it. After initialization, the plugin will stay attached to your website, and any text selection will fire Tweet it functionality.

4. Conclusion

In this article, we showcased TweetHighlighted plugin that can be used to increase interaction with our website users. The plugin allows visitors to create a tweet with highlighted text on the fly. Users will get the opportunity to share the content on Twitter and contribute to the dissemination of our website.

{{ message }}

{{ 'Comments are closed.' | trans }}