easy-touch

1.0.0 • Public • Published

easy-touch

a light weight javascript gestures library

Usage

npm install --save easy-touch

or

<script type="text/javascript" src='./dist/easy-touch.min.js'></script>
const touch = new Touch(window)
touch.on('pan', e => {
  if(e.type === 'panleft') console.log('finger is move to left')
})

API

on

on(str action, fn callback) 监听 action 动作

action 目前支持:

pan (滑动)

callback 需要一个参数 e,e 参数会有个 type 属性:

panpanleft, panright, panup, pandown

Readme

Keywords

Package Sidebar

Install

npm i easy-touch

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • limi58