1.0.4 • Published 6 years ago
wheel-direction v1.0.4
wheel-direction
なにこれ
方向付きWheelEventの実装。
使い方
$ npm i wheel-direction
import 'wheel-direction';
element.addEventListener('wheel-up', (e)=>{
console.log(e.type); // wheel-up
});
Events
- wheel-up
- wheel-down
- wheel-left
- wheel-right
- wheel-front
- wheel-back
API
ON/OFF
import ctrler from 'wheel-direction';
ctrler.enable();
ctrler.disable();
ctrler.toggle();
addEventListener options
// {passive: false}
const mod = import('wheel-direction?once=true&passive=false');
or
<!-- {once: true} -->
<script type="module" src="./wheel-direction.mjs?once=true"></script>