1.0.4 • Published 6 years ago

@shaaditech/scroll-handler v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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)  
  
Parameterstypeexample
elementhtml element nodedocument.getElementById('header')
callbackfunctionscrollPosition => {}
allowNextboolean (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

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2-test

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago