jQuery Plugin For Displaying Estimated Time To Read Text

File Size: 52.6 KB
Views Total: 2632
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin For Displaying Estimated Time To Read Text

Estimated Reading Time is a lightweight yet useful jQuery plugin that displays the estimated reading time and word counter for your web content. You can custom the reading speed in javascript to fit your needs.

How to use it:

1. Include the jQuery javascript library and jQuery Estimated Reading Time plugin on your website

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script src="src/estimatedReadingTime.js"></script> 

2. Create the html for the estimated reading time and word counter

<span id="eta"></span>
<span id="words"></span> words

3. Display the estimated reading time and word counter for the ARTICLE Selector

$(function() {

$('article').estimatedReadingTime({
readingTimeTarget: 'eta',
wordCountTarget: 'words',
readingSpeed: 275,
round: true,
});

});

4. Full plugin options.

readingTimeTarget: '.eta',
wordCountTarget: null,
wordsPerMinute: 270,
round: true,
lang: 'en',
lessThanAMinuteString: '',
prependTimeString: '',
prependWordString: '',
remotePath: null,
remoteTarget: null,
success: function() {},
error: function() {}

Change logs:

2018-03-01

  • updated syntax to be mostly es6 and fixed formatting

2015-06-20

  • added success and error callback functions

2014-03-13

  • updated method of parsing through remote file response

2014-02-28

  • fixed target for remote files and added demo of using multiple remote files

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