【文件属性】:
文件名称:javascripts的Timer
文件大小:377B
文件格式:RAR
更新时间:2013-07-01 07:59:40
js timer this 定时器
在ria设计中,js中使用settimeout,无法立刻使线程退出,所以写个timer,可以模拟到Timer的start和stop,
例子1:
var timer=new Timer();
var timerNum=0
timer.callback=function(){
timerNum++;
}
timer.start();
......
timer.stop();
例子2:var DIYclass=function(){
this.func=function(){
...
}
this.timer=new Timer();
this.timer.timeout=1000;
this.timer.callback=this.func;
this.timer.start();
......
}
文件很小,
【文件预览】:
timer.js