| 113 | a.set(res); |
| 114 | }, |
| 115 | frame = function (timeStamp) { |
| 116 | // Manual invokation? |
| 117 | if (!timeStamp) { |
| 118 | // Frame loop stopped? |
| 119 | if (!requestID) { |
| 120 | // Start frame loop... |
| 121 | requestID = requestAnimFrame(frame); |
| 122 | } |
| 123 | return; |
| 124 | } |
| 125 | var len = 0; |
| 126 | for (var i in animations) if (animations.hasOwnProperty(i)) { |
| 127 | var a = animations[i], |
| 128 | b = a.get(), |
| 129 | res; |
| 130 | len++; |
| 131 | a.s = (b - a.b) / (a.dur / a.spd); |
| 132 | if (a.s >= 1) { |
| 133 | delete animations[i]; |
| 134 | a.s = 1; |
| 135 | len--; |
| 136 | (function (a) { |
| 137 | setTimeout(function () { |
| 138 | eve("mina.finish." + a.id, a); |
| 139 | }); |
| 140 | }(a)); |
| 141 | } |
| 142 | a.update(); |
| 143 | } |
| 144 | requestID = len ? requestAnimFrame(frame) : false; |
| 145 | }, |
| 146 | /*\ |
| 147 | * mina |
| 148 | [ method ] |