首页 > 微信 > 详细

微信小程序 功能函数 touch触摸计时

时间:2018-01-22 13:35:17      阅读:323      评论:0      收藏:0      [点我收藏+]
shiFN:function(e){
// touchstart
// touchend
let that=this;
let n=0;
// 判断是开始还是结束的参数
let textTure = e.type;
that.setData({
textTure: textTure
})
if (textTure ==‘touchstart‘){
let lovetime = setInterval(function () {
n += 0.5;
 
if (that.data.textTure==‘touchend‘) {
clearInterval(lovetime);
}
console.log(n);
that.setData({
bian: n
})
}, 500)
 
}
},
 
<view class=‘bt-item‘ bindtouchend=‘shiFN‘ bindtouchstart=‘shiFN‘></view>

微信小程序 功能函数 touch触摸计时

原文:https://www.cnblogs.com/dianzan/p/8328547.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!