scroll-past

2.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    0
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i scroll-past

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • kevva