npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

scroll-direction

1.0.0

@hemanth

npmHomeRepoSnykSocket
Downloads:8
$ npm install scroll-direction
DailyWeeklyMonthlyYearly

scroll-direction

Get the scroll direction!

Install

$ npm install --save scroll-direction

Usage

const scrollDirection = require('scroll-direction');

scrollDirection(window, direction => (console.log(direction))); 

API

scrollDirection(domElement, cb)

domElement

Type: node

The DOM element on which you are intrested to listen on scroll.

cb

Type: function

The callback function, which responds with the direction

P.S: direction -> 1 is scroll up and 0 is scroll down.

License

MIT © Hemanth.HM