JSPM

normalize-wheel

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 937330
    • Score
      100M100P100Q184854F
    • License BSD-3-Clause

    Mouse wheel normalization across multiple multiple browsers.

    Package Exports

    • normalize-wheel

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (normalize-wheel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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.