Socket
Socket
Sign inDemoInstall

scroll-direction

Package Overview
Dependencies
4
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scroll-direction

Get the scroll direction!


Version published
Weekly downloads
1
Maintainers
1
Install size
32.9 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 02 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc