Socket
Book a DemoInstallSign in
Socket

scroll-past

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-past

Return a promise when any element is scroll past

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

scroll-past

Return a Promise when any element is scroll past

Install

$ npm install scroll-past

Usage

const scrollPast = require('scroll-past');

scrollPast(document.querySelector('.container')).then(pos => {
	console.log(`I'm at ${pos}`);
});

API

scrollPast(element, [options])

Returns a Promise that resolves the scrollY position of the window.

element

Type: Element

The element to check for.

options

threshold

Type: number
Default: 0

Add a threshold to scroll past before the Promise is returned.

License

MIT © Kevin Mårtensson

Keywords

past

FAQs

Package last updated on 28 Aug 2017

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