I have this:
this.slides[this.slideIndex].set('tween', {duration: '3000'});
this.slides[this.slideIndex].tween('opacity', '1');
how can i for example show an alert message after the effect has completed?
you can use
this.slides[this.slideIndex].set('tween',
{
duration: '3000',
onComplete: function() {alert('msg');}
}
);
You must use the Chain
feature.
this.slides[this.slideIndex].tween('opacity', '1');
this.slides[this.slideIndex].get('tween').chain(function() {
alert('Done...');
});
With chain()
method you can chain the execution of any number of functions. See here: http://mootools.net/docs/core/Class/Class.Extras
element.set('tween')
is called a new tween is added to the stack and that may not be desired.
Commented
Jun 4, 2014 at 10:04