touch-finger
v1.0.8
Published
[demo](https://uso.gitee.io/touch-finger/)
Downloads
5
Maintainers
Readme
touchFinger
安装
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: [email protected] weixin: chenjianbin519846538