New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wheel-indicator

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wheel-indicator

normalizes an inertial mousewheel

  • 1.1.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

wheel-indicator

Generates event when user makes new movement (like a touchstart on a touchscreen).

Build Status

trackpad

Connection

<script src="wheel-indicator.js"></script>

or if you use build system:

var WheelIndicator = require('wheel-indicator');

Usage

  var indicator = new WheelIndicator({
    elem: document.querySelector('.element'),
    callback: function(e){
      console.log(e.direction) // "up" or "down"
    }
  });

  //The method call
  indicator.getOption('preventMouse'); // true

API

Options

FieldTypeDefault valueMutable (by setOptions())Description
elemObject (dom node)documentNoDom node to listen wheel event on.
callbackFunction-YesThe callback, which will be triggered on gesture. Gets for the first argument a native wheel event object, extended by direction property, taking value 'up' or 'down'.
preventMouseBooltrueYesDisables mouse wheel working. In other words apply preventDefault() to wheel event.

Instance methods

| Method | Description | | ------- | ------- | ---------------------------------------- | | turnOff() | Turn off callback triggering | | turnOn() | Turn on callback trigerring | | setOptions( options ) | Sets the mutable options. The only argument must be Object. | | getOption( 'option' ) | Returns option value. The only argument must be String. | | destroy( ) | Removes event listener. |

Keywords

FAQs

Package last updated on 01 Aug 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc