Reading Position
A reading position indicator to show how far you are on a page or beween two points
The most important thing to remember when implementing this reading-position indicator is that the target element needs to be a progress
element or have the role progress
on it.
Examples
Usage
* Standalone JS is used on projects that are not set up to handle ES6. To use this version you will need to download the compiled JavaScript from the component's dist directory and pull it into your project. The same process should be followed with the CSS if it cannot process through the NPM package.
Documentation
Installation
This component accepts two arguments, the progress element DOM Node and an object containing optional callbacks.
npm install @10up/reading-position --save
API
onCreate | Called after the reading position is initialized on page load. |
---|---|
scrollStart | Called when an accordion item is opened |
scrolling | Called when an accordion item is closed |
scrollEnd | Called when an accordion item is toggled |
Class
.reading-position | Class for the progress element. |
---|
Browser Compatibility
Chrome | Latest |
---|---|
Firefox | Latest |
Edge | Latest |
Safari | Latest |
IE | 11 |