peach a19a732be8 commit message 2 年之前
..
src a19a732be8 commit message 2 年之前
LICENSE a19a732be8 commit message 2 年之前
README.md a19a732be8 commit message 2 年之前
index.js a19a732be8 commit message 2 年之前
package.json a19a732be8 commit message 2 年之前

README.md

Normalize Wheel

Mouse wheel normalization across multiple multiple browsers.

Original source

This code is extracted and from Facebook's Fixed Data Table. Apart from import fixes, the code is unmodified.

Usage

Just add it as an dependency in npm.

You can use it as follows:

import normalizeWheel from 'normalize-wheel';

document.addEventListener('mousewheel', function (event) {
    const normalized = normalizeWheel(event);

    console.log(normalized.pixelX, normalized.pixelY);
});

License

See the LICENSE file.