Hello
I've some message text that I like to appear immediately and then
disappear after e.g. 3.5 secs.
If I like to show another message while the effect is still running, I
like to cancel the effect and start showing the new message.
The following code works somewhat but it still seems to chain up the
messages to show - hope somebody can tell me what I'm missing:
showStatus: function(msg) {
var el = document.id('statusID');
el.set('text', msg.toUpperCase());
if (!$defined(this.fxStatus)) {
this.fxStatus = new Fx.Tween(el, {
'property': 'opacity',
duration: 700
});
} else {
this.fxStatus.cancel();
this.fxStatus.set('opacity', 0);
}
this.fxStatus.set('opacity', 1);
this.fxStatus.start.pass([1,0], this.fxStatus).delay(3500);
},
Thanks