Update for performance, stability
* Performance improved at least 4 times faster now * Stability & Responsiveness Improved * Reduced lags for animation & load-execution time * New demo : * This demo requires `kute-css plug-in` ```html``` <div class="dv"></div> <div class="dv"></div> <div class="dv"></div> ``` ```javascript var tl = new KUTE.Timeline(); tl.fromTo('.dv', { rotate : 0, left : 0 }, { rotate : 45, left : 200 }, { easing : 'easingBounceInOut', offset : { rotate : 200, left : 50 } }) tl.to('.dv', { backgroundColor : 'rgb(255, 204, 0)' }, { easing : { backgroundColor : 'easingExponentialInOut'}, offset: 300 }); tl.to('.dv', { top : 200 }, { easing : { top : 'easingElasticInOut' }, offset: 300, duration : 1000 }); tl.to('.dv', { width : 45 }, { easing : { width : 'easingElasticInOut' }, offset: 200, duration : 1000 }); tl.fromTo('.dv', { backgroundColor : 'rgb(255, 204, 0)' }, { backgroundColor : 'rgb(0, 204, 255)' }, { easing : { backgroundColor : 'linear'}, offset: 300 }); tl.to('.dv', { height : 45 }, { easing : { height : 'easingElasticInOut' }, offset: 200, duration : 1000 }); tl.fromTo('.dv', { rotate : 45 }, { rotate : 0 }, { easing : { rotate : 'easingExponentialInOut' }, offset : { rotate : 200 } }) tl.fromTo('.dv', { width : 45, height : 45 }, { width : 100, height : 100 }, { easing : 'easingElasticInOut', offset : 200 }) tl.fromTo('.dv', { left : 200, top : 200 }, { left : 0, top : 0 }, { easing : 'easingElasticInOut', offset : 200 }) tl.start(); ```
This commit is contained in:
parent
7c1eba4825
commit
c03e1b936b
|
@ -41,6 +41,7 @@
|
|||
for (var set in options) {
|
||||
opt[set] = options[set][prop] || options[set] || defOpt[set][prop] || defOpt[prop];
|
||||
}
|
||||
}
|
||||
var offset = opt.offset || 0;
|
||||
opt.delay = (opt.delay || 0) + _totalTime;
|
||||
for (var i = 0, len = all.length; i < len; i++) {
|
||||
|
@ -54,9 +55,8 @@
|
|||
}
|
||||
_totalTime += opt.duration || 1000;
|
||||
this._startTime.push((this._startTime[this._startTime.length - 1] || 0));
|
||||
}
|
||||
|
||||
return this.start();
|
||||
return this;
|
||||
};
|
||||
this.to = function (els, to, opt) {
|
||||
return this.tween(els, to, opt);
|
||||
|
@ -69,9 +69,7 @@
|
|||
s = this;
|
||||
for (var i = 0, len = t.length; i < len; i++) {
|
||||
for (var it = 0, lent = this._tweens.length; it < lent; it++) {
|
||||
for (var el = 0, len2 = this._collection.length; el < len2; el++) {
|
||||
this._tweens[it][prop].apply(this._tweens[it], v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue