| | |
| | | |
| | | this.isPause = false; |
| | | this.isRunning = false; |
| | | this.isStop = true; |
| | | // 是否开启动态绘制速度 |
| | | this.dynamicSpeed = false; |
| | | // 每个任务耗时(秒) |
| | |
| | | |
| | | FrameAnimation.prototype = { |
| | | start: function () { |
| | | if (this.intervalFlag != undefined) { |
| | | this.isPause = false; |
| | | } else { |
| | | this.isRunning = true; |
| | | // 不存在动画任务时重新开始,否则继续 |
| | | if (this.intervalFlag == undefined) { |
| | | this._doTask(); |
| | | } |
| | | this.isPause = false; |
| | | this.isStop = false; |
| | | this.isRunning = true; |
| | | }, |
| | | /** |
| | | * 动态动画速度 |
| | |
| | | }, |
| | | pause: function () { |
| | | this.isPause = true; |
| | | this.isRunning = false; |
| | | }, |
| | | stop: function () { |
| | | if (this.isStop) return; |
| | | |
| | | if (this.intervalFlag != undefined) { |
| | | clearInterval(this.intervalFlag); |
| | | this.intervalFlag = undefined; |
| | |
| | | |
| | | this.isRunning = false; |
| | | this.isPause = false; |
| | | this.isStop = true; |
| | | this.lastestTime = undefined; |
| | | this.speed = 1; |
| | | }, |
| | | setOnStopCallback: function (callback) { |
| | | this.onStopCallback = callback; |
| | |
| | | t.task(t.data, index, t.count); |
| | | |
| | | index += this.speed; |
| | | // console.log("_doTask:" + index); |
| | | }, this.timeout); |
| | | } |
| | | }, |