# mouse-wheel

> Consistent cross browser mouse wheel movement

Latest version **1.2.0** (published 2016-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install mouse-wheel
pnpm add mouse-wheel
yarn add mouse-wheel
bun add mouse-wheel
```

## 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.2.0 |
| Published | 2016-07-04 |
| First published | 2015-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 53 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | mouse, wheel, browser, speed, consistent, portability, poly, fill, fix |

## Links

- npm: https://www.npmjs.com/package/mouse-wheel
- Repository: https://github.com/mikolalysenko/mouse-wheel
- Issues: https://github.com/mikolalysenko/mouse-wheel/issues
- npm.io page: https://npm.io/package/mouse-wheel

## Dependencies (3)

- [to-px](https://npm.io/package/to-px.md) ^1.0.1
- [signum](https://npm.io/package/signum.md) ^1.0.0
- [right-now](https://npm.io/package/right-now.md) ^1.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2016-07-04
- 1.1.0 — 2016-02-16
- 1.0.2 — 2015-02-18
- 1.0.1 — 2015-02-17
- 1.0.0 — 2015-02-17

## README

mouse-wheel
===========
Consistent cross browser mouse wheel events.  [Test it out in your browser here](https://mikolalysenko.github.io/mouse-wheel/).

# Example

```javascript
require('mouse-wheel')(function(dx, dy) {
  document.body.innerHTML = '<p>Scroll:' + [dx,dy] + '</p>'
})
```

# Install

```
npm i mouse-wheel
```

# API

#### `require('mouse-wheel')(element, callback, noScroll)`
Hook an event handler for the mouse wheel on `element`.

* `element` is an optional DOM element, or if unspecified then is the window object.
* `callback(dx, dy, dz, ev)` is called whenever the mouse scrolls
    + `dx, dy, dz` is the amount of scrolling vertically, horizontally and depth-wise in pixels
    + `ev` is the MouseEvent object associated with the event
* `noScroll` is an optional flag, which if set disables scrolling the page

Returns listener function `listener` so that it may be detached later with `element.removeEventListener('wheel', listener)`

# License
(c) 2015 Mikola Lysenko. MIT License

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