1. normalize-wheel
Mouse wheel normalization across multiple multiple browsers.
normalize-wheel
Package: normalize-wheel
Last modified: Wed, 22 Jun 2022 05:35:17 GMT
Version: 1.0.1
License: BSD-3-Clause
Downloads: 1,798,345

Install

npm install normalize-wheel
yarn add normalize-wheel

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code