2

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?

2 Answers 2

7

you can use

this.slides[this.slideIndex].set('tween', 
{
 duration: '3000',
 onComplete: function() {alert('msg');}
}

);
0
3

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

1
  • 2
    While the accepted answer is valid, this one is a better solution for repetitive actions, such as opening/closing an accordion, because this solution does not add more tweens. Each time 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.