var _bindTouSta = function(e) {
console.log(this)
clearInterval(this.setInter)
this.touchTime = new Date().getTime()
this.tPage = {
sx: e.targetTouches[0].pageX,
sy: e.targetTouches[0].pageY,
ex: e.targetTouches[0].pageX,
ey: e.targetTouches[0].pageY
}
this.isScrool = 0
}
var _bindTouMov = function(e) {
this.tPage.sx = e.targetTouches[0].pageX
this.tPage.sy = e.targetTouches[0].pageY
if (e.targetTouches.length > 1 || e.scale && e.scale !== 1)
return;
}
var _bindTouEn = function(e) {
var x = this.tPage.sx - this.tPage.ex
var y = this.tPage.sy - this.tPage.ey
var durTime = (new Date).getTime() - this.touchTime
this.isScrool = Math.abs(x) > Math.abs(y) ? 1 : 0
if (Math.abs(x) > Math.abs(y) && x > 0) {
console.log('left to right')
} else if (Math.abs(x) > Math.abs(y) && x < 0) {
console.log('right to left')
} else if (Math.abs(y) > Math.abs(x) && y > 0) {
console.log('top to bottom')
} else if (Math.abs(y) > Math.abs(x) && y < 0) {
console.log('bottom to top')
} else {
if (durTime > 300) {
console.log('changan')
} else {
console.log('click')
}
}
}
var _bindFun = function() {
this.elementJieDian.addEventListener('touchstart', _bindTouSta.bind(this), false)
this.elementJieDian.addEventListener('touchmove', _bindTouMov.bind(this), false)
this.elementJieDian.addEventListener('touchend', _bindTouEn.bind(this), false)
}