Tweet Highlighted (Selected) Text with jQuery

Tweet any web page highlighted text just after selecting it. Yes, this jQuery plugin let’s you to share highlighted text on twitter with simple and easy way.

Plugin Overview

Plugin: TweetHighlighted
Author: Waldo Broodryk
Licence: MIT Licence
Published: 2019-03-25 04:26:44
Repository: Fork on CodePen
Dependencies: jQuery 3.3.1 or Latest version
File Type: zip archive (HTML, CSS & JavaScript)
Package Size: 134 KB

How to Use Tweet Highlighted Text Plugin:

1. To use this plugin, load the jQuery and webflow JavaScript file into HTML document.

<!-- 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 the plugin with the body sector and define minimum & maximum text length that will be tweeted. The statements are:

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

Be the first to comment

Leave a Reply

Your email address will not be published.


*