Function normalizeWheel

  • Normalize wheel delta. This function is re-exported from normalize-wheel for convenience. It helps normalize the wheel event's delta values (spinX, spinY, pixelX, pixelY) across different browsers.

    Parameters

    • event: WheelEvent

    Returns {
        pixelX: number;
        pixelY: number;
        spinX: number;
        spinY: number;
    }

    • pixelX: number
    • pixelY: number
    • spinX: number
    • spinY: number

    See

    https://www.npmjs.com/package/normalize-wheel

    Example

    document.addEventListener('wheel', (event) => {
    const normalized = normalizeWheel(event);
    console.log(normalized);
    // => { spinX: -0, spinY: 1.25, pixelX: -0, pixelY: 125 }
    });