apropo, mi sono ricordato che non è necessario riscrivere Fx, basta reimplementare i metodi:
Vorrei dirti che è stata un'idea mia, ma bisogna dare a Scott quello che è di Scott (è un'idea sua), tra l'altro, lui mi raccomandava di non implementare un evento onStep perché rallenterebbe l'effetto in modo eccessivo (dato che usa una RegExp per controllare gli on*** e tradurli in eventi).Codice PHP:Fx.implement({
step: function(){
var time = $time();
if (time < this.time + this.options.duration){
var delta = this.transition((time - this.time) / this.options.duration);
this.fireEvent('step', [this.subject, delta]);
this.set(this.compute(this.from, this.to, delta));
} else {
this.fireEvent('step', [this.subject, delta]);
this.set(this.compute(this.from, this.to, 1));
this.complete();
}
},
pause: function(){
if(this.stopTimer())this.fireEvent('pause', this.subject);
return this;
},
resume: function(){
this.fireEvent('resume', this.subject);
this.startTimer();
return this;
},
});
In effetti, credo che sarebbe meglio se spezzassi la transizione in due e la legassi tramite il chain
http://mootools.net/docs/core/Class/Class.Extras

Rispondi quotando