1.0.0-beta.5 • Published 4 years ago
ph-gesture
Licence
—
Version
1.0.0-beta.5
Deps
1
Size
7 kB
Vulns
0
Weekly
0
Welcome to your new awesome project!
This project has been created using webpack-cli, you can now run
npm i ph-gesture
update
- touchmove event meta:{tx,ty,dx,dy,end,speed} usage
//支持的手势事件
type TouchType = 'tap'|'longtap'|'swipe'|'swipeleft'|'swiperight'|'swipedown'|'swipeup'|'touchmove'
import PhGesture from 'ph-gesture'
const dom = document.body
const callback = (e:Event,type:string)=>{
///todo?
}
new PhGesture(dom,callback,'swipe',{select?:boolean,stop?:boolean,timeout?:number,capture?:boolean})
new PhGesture(dom,callback,'swipeleft')
new PhGesture(dom,callback,'swiperight')
new PhGesture(dom,callback,'swipetop')
new PhGesture(dom,callback,'swipebottom')
new PhGesture(dom,callback,'tap')
new PhGesture(dom,callback,'longtap')