Article Word Counter Reading Time Plugin jQuery KeepReading - Download Article Word Counter & Reading Time Plugin - jQuery KeepReading

Download Article Word Counter & Reading Time Plugin – jQuery KeepReading

Posted on

This time I will share jQuery Plugin and tutorial about Article Word Counter & Reading Time Plugin – jQuery KeepReading, hope it will help you in programming stack.

Article Word Counter Reading Time Plugin jQuery KeepReading - Download Article Word Counter & Reading Time Plugin - jQuery KeepReading

File Size: 87.8 KB
Views Total: 637
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

KeepReading is a jQuery plugin that counts the number of words in your article and displays the estimated article reading time inspired by Medium.com.

How to use it:

1. Load the JavaScript file keepreading.js after jQuery library and the KeepReading is ready for use.

1 <script src="//code.jquery.com/jquery-3.1.1.slim.min.js"></script>
2 <script src="scripts/keepreading.min.js"></script>

2. Add the CSS class ‘keepreading’ to your article and then create the DIV elements as shown below to display the word count and estimated article reading time.

1 <article class="keepreading">
2   <h1>Article Title</h1>
3   <h5 class="keepreading__time"></h5>
4   <span class="keepreading__words"></span>
5   <p>Main Content Here</p>
6 </article>

3. That’s it. You’re allowed to customize the average Reading Time (words per minute) in the JavaScript as this.

1 $('article').keepReading({
2   averageReadingTime: 240
3 });

4. More config settings with default values.

01 $('article').keepReading({
02  
03   // target article
04   keepReading: $('.keepreading'),
05  
06   // for remote article
07   keepReadingRemoteTarget: null,
08   keepReadingRemotePath: null,
09  
10   // displays word count
11   keepReadingWordCount: true
12    
13 });

5. Available callback functions.

1 $('article').keepReading({
2  
3   success: function success() {},
4   error: function error() {}
5  
6 });

Change log:

2017-07-12

2017-05-12

  • JS update

2017-03-29

  • Fixed for remote data

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

source : jqueryscript.net