Socket
Book a DemoInstallSign in
Socket

scroll-speed

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-speed

Get the scroll speed being used on either the window or a particular element.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
503
155.33%
Maintainers
1
Weekly downloads
 
Created
Source

scroll-speed experimental

Get the scroll speed being used on either the window or a particular element.

Usage

NPM

speed = scroll(element, [preventDefault])

Listens to element for scroll events. If you don't supply an element, this will default to window. Pass preventDefault as true to override the default scrolling behavior.

speed.on('scroll', callback(event))

Calls callback whenever a scroll event is captured, passing a normalized wheel event for you to read from.

speed.flush()

You need to call at the end of each frame for the module to work properly – we need to cater to the possibility of multiple events per frame. Stick this at the end of your requestAnimationFrame or setInterval loop.

speed[0]

The horizontal speed of the scroll.

speed[1]

The vertical speed of the scroll.

speed[2]

The depth speed of the scroll – you never know!

License

MIT. See LICENSE.md for details.

Keywords

scroll

FAQs

Package last updated on 10 Nov 2014

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.