Package Exports
- mouse-wheel
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mouse-wheel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mouse-wheel
Consistent cross browser mouse wheel events. Test it out in your browser here.
Example
require('mouse-wheel')(function(dx, dy) {
document.body.innerHTML = '<p>Scroll:' + [dx,dy] + '</p>'
})Install
npm i mouse-wheelAPI
require('mouse-wheel')(element, callback, noScroll)
Hook an event handler for the mouse wheel on element.
elementis an optional DOM element, or if unspecified then is the window object.callback(dx, dy, dz)is called whenever the mouse scrollsdx, dy, dzis the amount of scrolling vertically, horizontally and depth-wise in pixels
noScrollis an optional flag, which if set disables scrolling the page
License
(c) 2015 Mikola Lysenko. MIT License