# scroll-speed

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

Latest version **1.0.0** (published 2014-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install scroll-speed
pnpm add scroll-speed
yarn add scroll-speed
bun add scroll-speed
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-11-10 |
| First published | 2014-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | scroll, speed, event, motion, mouse, wheel |

## Links

- npm: https://www.npmjs.com/package/scroll-speed
- Repository: https://github.com/hughsk/scroll-speed
- Issues: https://github.com/hughsk/scroll-speed/issues
- npm.io page: https://npm.io/package/scroll-speed

## Dependencies (2)

- [wheel](https://npm.io/package/wheel.md) 0.0.0
- [events](https://npm.io/package/events.md) ^1.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-11-10
- 0.0.0 — 2014-05-12

## README

# scroll-speed [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

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

## Usage

[![NPM](https://nodei.co/npm/scroll-speed.png)](https://nodei.co/npm/scroll-speed/)

### 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](http://github.com/hughsk/scroll-speed/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/scroll-speed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
