Show:

annie.Timer Class

Defined in: libs/Timer.js:11
Module: annie

Available since 1.0.9

定时器类

Methods

kill

() public

Defined in libs/Timer.js:165

Available since 1.0.9

定时器不用了,一定要记得杀死它,不然他会变成厉鬼,时时缠绕着你

repeatCount

() Number public

Defined in libs/Timer.js:133

Available since 1.0.9

执行触发Timer 的总次数

Returns:

reset

() public

Defined in libs/Timer.js:65

Available since 1.0.9

重置定时器

start

() public

Defined in libs/Timer.js:77

Available since 1.0.9

开始执行定时器

stop

() public

Defined in libs/Timer.js:90

Available since 1.0.9

停止执行定时器,通过再次调用start方法可以接着之前未完成的状态运行

Timer

(
  • delay
  • repeatCount
)

Defined in libs/Timer.js:31

构造函数,初始化

Parameters:

Example:

 var timer=new annie.Timer(1000,10);
 timer.addEventListener(annie.Event.TIMER,function (e) {
     console.log("once");
 })
 timer.addEventListener(annie.Event.TIMER_COMPLETE, function (e) {
     console.log("complete");
     e.target.kill();
 })
 timer.start();

Properties

currentCount

Unknown public

Defined in libs/Timer.js:100

Available since 1.0.9

当前触发了多少次Timer事件

delay

Unknown public

Defined in libs/Timer.js:115

Available since 1.0.9

设置或者获取当前定时器之间的执行间隔

running

Unknown

Defined in libs/Timer.js:153

Available since 1.0.9

当前是否在运行中

Events

annie.Event.TIMER

Defined in libs/Timer.js:20

Available since 1.0.9

annie.Timer定时器触发事件

annie.Event.TIMER_COMPLETE

Defined in libs/Timer.js:25

Available since 1.0.9

annie.Timer定时器完成事件