Socket
Book a DemoInstallSign in
Socket

wheel-gestures

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wheel-gestures

wheel gestures and momentum detection

2.2.48
latest
Source
npmnpm
Version published
Weekly downloads
180K
7.56%
Maintainers
1
Weekly downloads
 
Created

What is wheel-gestures?

The wheel-gestures npm package is designed to handle wheel gestures in web applications. It provides a way to interpret and respond to wheel events, such as scrolling, with more control and precision than native browser events.

What are wheel-gestures's main functionalities?

Handling Wheel Gestures

This feature allows you to attach wheel gesture event listeners to DOM elements. The code sample demonstrates how to import the WheelGestures module, create an instance, and attach it to an element to listen for wheel gestures.

import { WheelGestures } from 'wheel-gestures';

const element = document.getElementById('myElement');
const wheelGestures = WheelGestures();

wheelGestures.on(element, (event) => {
  console.log('Wheel gesture detected:', event);
});

Customizing Gesture Sensitivity

This feature allows customization of gesture sensitivity and behavior. The code sample shows how to configure the WheelGestures instance with a custom threshold and passive option, affecting how wheel events are processed.

import { WheelGestures } from 'wheel-gestures';

const wheelGestures = WheelGestures({
  threshold: 10,
  passive: false
});

wheelGestures.on(document.body, (event) => {
  console.log('Custom sensitivity wheel gesture:', event);
});

Other packages similar to wheel-gestures

Keywords

wheel

FAQs

Package last updated on 31 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.