TypechoJoeTheme

至尊技术网

统计
登录
用户名
密码

微信小程序长按事件

2022-07-15
/
0 评论
/
862 阅读
/
正在检测是否收录...
07/15


<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('长按')   
    }  
}

微信小程序经验长按事件
朗读
赞(1)
版权属于:

至尊技术网

本文链接:

https://www.zzwws.cn/archives/6347/(转载时请注明本文出处及文章链接)

评论 (0)