• Stars
    star
    553
  • Rank 80,112 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

How long you'll need to read an article

ReadRemaining.js

This jQuery plugin allows you to show the user how long it will take to read the article considering the speed in which the user is scrolling.

Check out the demo

Quick start

Load the readremaining.jquery.js or the minified version readremaining.jquery.min.js after jQuery.

<script src="js/readremaining.jquery.js"></script>

Include the css file or the styles into your main css.

<link rel="stylesheet" href="css/rr_light.css"/>

To speed up the loading, you can include the code of readremaining.jquery.js in your main js file instead.

Init ReadRemaining.js on the element that will be scrolled to read the article. Usually the body of the document.

$('body').readRemaining();

That's it.

Customizing ReadRemaining.js

You can customize the behavior of the gauge with these options:

$('body').readRemaining({
  showGaugeDelay   : 1000,           // Delay before showing the indicator.
  showGaugeOnStart : false,          // Show the gauge initially, even before the user scroll.
  timeFormat       : '%mm %ss left', // Will replace %m and %s with minutes and seconds.
  maxTimeToShow    : 20*60,          // Only show time if is lower than x minutes (multiplied to seconds).
  minTimeToShow    : 10,             // Only show time if is higher than x seconds (If it's less than 10 seconds... just read).
  gaugeContainer   : '',             // The element where the gauge will append. If left '', the container will be the same scrolling element.
  insertPosition   : 'prepend'       // 'append' or 'prepend' as required by style
  verboseMode      : false           // Enable the console logs. For testing only.
  gaugeWrapper     : '',             // Optional, the element that define the visible scope for the gauge. If left "", the gauge will be visible all along.
  topOffset        : 0,              // Distance between the top of the gaugeWrapper and the point where the gauge will start to appear. Some designs require this.
  bottomOffset     : 0               // Distance between bottom border where the box will appear and the bottom of the element.
});

Other methods

You can get the remaining time for reading an element with ReadRemaining.js applied with the 'getRemainingTime' method. e.g.:

var remainingMinutes = $('body').readRemaining('getRemainingTime', {timeFormat : '%m'});

Known Issues

ReadRemaining.js works much more precise when the content of the scrolling element is homogeneous. If the size of the text or complexity of images change in different parts of the scrolling element, then the accuracy will drop.

Plugins

More Repositories

1

midnight.js

Switch your nav's design on the fly
JavaScript
3,669
star
2

blockrain.js

HTML5 Tetris Game for jQuery
JavaScript
954
star
3

nextjs-pwa

Build a PWA with Next.JS
JavaScript
142
star
4

setup

Make your Mac Aerowesome
Python
134
star
5

frontend-developer-coding-challenge

Are your looking for a remote developer job? Solve this frontend developer challenge and show us what you can do and what you are an expert at!
125
star
6

rooms

A simple Display for Meeting Rooms
JavaScript
102
star
7

pixelcounterapp

How many pixels have you crafted?
HTML
68
star
8

booom

Dribbble Enhancement Suite
JavaScript
51
star
9

lullaby

A treatment for tinnitus
JavaScript
44
star
10

youtube-tv

Build a desktop app with Node Webkit
JavaScript
42
star
11

subtle-animations

How to add simple UI details
CSS
35
star
12

coding-challenges

Show your abilities as a developer
HTML
35
star
13

welcome

A macOS app to onboard new Aerolabers
JavaScript
34
star
14

platzi-pwa

Material de PWA en Platzi
JavaScript
28
star
15

acanohayluz

Reporte de cortes de luz en Argentina
PHP
20
star
16

workshop-nextjs

Aprendiendo Next.JS
JavaScript
16
star
17

pixelcounter

Count the pixels in all the images in a folder
JavaScript
15
star
18

svg

The SVG Workflow
HTML
15
star
19

aerolab.github.io

Open Source Projects by Aerolab
JavaScript
13
star
20

activate-mac

Activate Windows. For Mac.
JavaScript
12
star
21

criterios

Criterios de Calidad de Aerolab
HTML
11
star
22

fullstack-developer-coding-challenge

HTML
11
star
23

aerolab-cli

A tool for automating dev tasks
JavaScript
10
star
24

perfect

The only perfect piece of software
9
star
25

platzi-nextjs

Material de Next.JS en Platzi
JavaScript
9
star
26

iojs-colorpicker

A color picker for our IO.JS logo
JavaScript
8
star
27

nokia-psd

The long-awaited PSD for Nokia 1100
SCSS
7
star
28

type

Workshop de tipografía
CSS
7
star
29

jsconf2014-workshop

Node-Webkit Workshop for JSConf
JavaScript
7
star
30

meeting-quantifier

How much did you spend on that meeting?
CSS
6
star
31

goldenimage.js

Fix camera rotation of an image
JavaScript
6
star
32

iojs-logo

IO.JS Logo Proposal
6
star
33

nextjs-routing

Routing y Layout avanzado con Next.JS
JavaScript
5
star
34

rosarigasino

Egasel mejogasor lenguagasaje degasel mugasundo
JavaScript
5
star
35

zeplin-renamer

Rename Zeplin images for React Native
Python
5
star
36

nextjs-intro

Introducción a Next.JS y Styled JSX
JavaScript
5
star
37

origami

Workshop de Origami
3
star
38

startupmap

Mapping Startups in Latin America
CSS
3
star
39

tutorial-navigator

A tutorial for Auth0
JavaScript
1
star
40

meeetup

Buenos Aires Dribbble Meetup 2014
1
star
41

next-sanity-starter

Next.js starter with Santy
TypeScript
1
star