@shaaditech/scroll-handler

1.0.4 • Public • Published

Documentation

Scroll handler helps you manage all window scroll events at a single place.

Installation

npm

  
npm i @shaaditech/scroll-handler  
  

yarn

  
yarn add @shaaditech/scroll-handler  
  

API

registerScrollToView(element, callback, allowNext, delay)

To register the callback when the element appears in the viewport.

  
registerScrollToView(element, scrollPosition => {}, false, 0)  
  
Parameters type example
element html element node document.getElementById('header')
callback function scrollPosition => {}
allowNext boolean (default false) true/false
delay (milliseconds) int (default 0) 1000

unregisterScrollToView(element, callback)

This function unregisters the element. Here, the second parameter is callback function which will be called when the element is unregistered.

isScrollIntoView(element)

To check if the element is in viewport.

Contact

If you have an issue, feel free to contact me @shivamsupr

Readme

Keywords

Package Sidebar

Install

npm i @shaaditech/scroll-handler

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

130 kB

Total Files

11

Last publish

Collaborators

  • indusoni
  • phenax
  • shaaditechroot