接管touchStart touchEnd
touchStart 中开始 调用setInterval 循环执行递增
touchEnd 清除递增!
var Model = function(){ this.callParent(); this.test = justep.Bind.observable(0); }; Model.prototype.button1Touchstart = function(event){ var me = this; this.interval = setInterval(function(){ //开启定时器 me.test.set(me.test.get()+ 1 ); },1000); }; Model.prototype.button1Touchend = function(event){ clearInterval(this.interval); };
评一波