-1
當前這導致(圖像)淡出函數結束,然後淡入函數觸發。我需要圖像交叉淡入淡出和每個圖像的不透明度重疊。我很難得到這份工作。想法?同時調用js函數yui
_initFade: function() {
this._timer = Y.later(this._intervalDuration, this, this._startPeriod, [], false);
},
_startPeriod: function() {
this._timer = Y.later(this._intervalDuration, this, this._fadeOut, [], true);
this._fadeOut();
},
_fadeOut: function(){
var host = this.get('host');
this._animOut.set('node', host._getCurrentBlock());
this._animOut.once('end', this._fadeIn, this);
this._animOut.run();
},
_fadeIn: function(){
var host = this.get('host'),
blocks = host.get('blocks'),
index = host.get('index');
index = host._moveIndex(host._getNextIndex());
var nextBlock = blocks.item(index);
this._transparent(nextBlock);
host.syncUI();
this._animIn.set('node', nextBlock);
this._animIn.run();
},
有趣。我不一定會在乎他們完全同步壽命,是不是可以同時觸發兩個動畫?即使不同步/ – ndreckshage 2012-08-06 22:51:43
當然,你可以做'var anim1 = new Y.Anim(); anim2 = new Y.Anim(); anim1.run(); anim2.run();」它不會像使用補間事件一樣好看。 – 2012-08-07 09:26:03