至尊技术网 - 长按事件
https://www.zzwws.cn/tag/%E9%95%BF%E6%8C%89%E4%BA%8B%E4%BB%B6/
-
微信小程序长按事件
https://www.zzwws.cn/archives/6347/
2022-07-15T11:28:00+08:00
<view bindtouchstart="touchstart" bindtouchend="touchend">123456</view>
//touch start
touchstart: function(e) {
this.startTime = e.timeStamp;
console.log(this.startTime)
},
//touch end
touchend: function(e) {
this.endTime = e.timeStamp;
console.log(this.endTime)
console.log("endTime - startTime = " + (this.endTime-this.startTime));
if (this.endTime - this.startTime>600){
console.log('长按')
}
}