Get the scroll direction!
$ npm install --save scroll-direction
const scrollDirection = require('scroll-direction');
scrollDirection(window, direction => (console.log(direction)));
Type: node
The DOM element on which you are intrested to listen on scroll.
Type: function
The callback
function, which responds with the direction
P.S: direction
-> 1
is scroll up and 0
is scroll down.
MIT © Hemanth.HM