Socket
Socket
Sign inDemoInstall

@kensingtontech/hamsterjs

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @kensingtontech/hamsterjs

A standalone javascript library for cross-browser mouse wheel support


Version published
Maintainers
1
Created

Readme

Source

Hamster.js

A standalone javascript library for cross-browser mouse wheel support.

See it in action.

Usage

The event callback receives 3 extra arguments which are the normalized “deltas” of the mouse wheel.

var hamster = Hamster(el, false); // boolean is whether passive = true | false

hamster.wheel(function(event, delta, deltaX, deltaY){
  console.log(delta, deltaX, deltaY);
});

// destroy
hamster.unwheel();

Support

The second parameter to Hamster() is optional, and indicates whether to mark the event listener as passive, for performance. Please do your research about passive event listeners before turning this on.

No jQuery or other libraries are required, but an adapter for AngularJS is available.

Tested in these core browsers.

Install

npm install hamsterjs
bower install hamsterjs

Demo

monospaced.github.io/hamster.js

Reference

Keywords

FAQs

Last updated on 10 May 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc