new AlloyFinger(element, {
pointStart: function () {
},
multipointStart: function () {
},
rotate: function (evt) {
console.log(evt.angle);
},
pinch: function (evt) {
console.log(evt.scale);
},
multipointEnd: function () {
},
pressMove: function (evt) {
console.log(evt.deltaX);
console.log(evt.deltaY);
},
tap: function (evt) {
},
doubleTap: function (evt) {
},
longTap: function (evt) {
},
swipe: function (evt) {
console.log("swipe" + evt.direction);
},
singleTap: function (evt) {
}
});
render() {
return (
<AlloyFinger
onTap={this.onTap.bind(this)}
onMultipointStart={this.onMultipointStart.bind(this)}
onLongTap={this.onLongTap.bind(this)}
onSwipe={this.onSwipe.bind(this)}
onPinch={this.onPinch.bind(this)}
onRotate={this.onRotate.bind(this)}
onPressMove={this.onPressMove.bind(this)}
onMultipointEnd={this.onMultipointEnd.bind(this)}
onDoubleTap={this.onDoubleTap.bind(this)}>
<div className="test">the element that you want to bind event</div>
</AlloyFinger>
);
}
You can install it via npm:
npm install alloyfinger
This content is released under the MIT License.