1.0.8 • Published 5 years ago

touch-finger v1.0.8

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

touchFinger

demo

安装

npm install touch-finger

引入方式

CommonJS 或者 es6引入方式

  import touchFinger from 'touch-finger';

原始引入方式

    <script type="text/javascript" src="touchFinger.js"></script>

touchFinger.min.js在dist目录

使用

const fingerInstance = new touchFinger(element, {
  touchStart () { },
  touchMove () { },
  touchEnd:  function () { },
  touchCancel () { },
  multipointStart () { },
  multipointEnd () { },
  tap () { },
  doubleTap () { },
  longTap () { },
  singleTap () { },
  rotate (evt) {
    console.log(evt.angle);
  },
  pinch (evt) {
    console.log(evt.zoom);
  },
  pressMove (evt) {
    console.log(evt.pressMoveDirection);
    console.log(evt.deltaX);
    console.log(evt.deltaY);
  },
  swipe (evt) {
    console.log("swipe" + evt.direction);
  }
});

const onTap = function() {};

fingerInstance.on('tap', onTap);
fingerInstance.on('touchStart', function() {});
fingerInstance.off('tap', onTap);

fingerInstance.destroy();

联系

Email: usocjb@163.com weixin: chenjianbin519846538

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago