Socket
Book a DemoInstallSign in
Socket

@10up/reading-position

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@10up/reading-position

A component that reports reading position/progress on a page while scrolling.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
124
27.84%
Maintainers
7
Weekly downloads
 
Created
Source

10up Reading Position component

View official documentation for this package

Installation

npm install @10up/reading-position --save

Usage

CSS Imports

@import url("@10up/reading-position");

The styles can be imported into your existing codebase by using PostCSS imports, or by including the standalone CSS file in your project.

JavaScript

Create a new instance by supplying the selector to use for the reading-position and an object containing any necessary callback functions.

import ReadingPosition from '@10up/reading-position';

new ReadingPosition( '.reading-position', {
	onCreate: function() {
		console.log( 'onCreate callback' );
	},
	scrollStart: function( percentage ) {
		console.log( 'scrollStart callback', percentage );
	},
	scrollEnd: function( percentage ) {
		console.log( 'scrollEnd callback', percentage );
	},
	scrolling: function( percentage ) {
		console.log( 'scrolling callback', percentage );
	}
} );

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Like what you see?

Work with 10up

FAQs

Package last updated on 27 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts