Mootools, do something then do something else

61 views Asked by At

is a more efficient way of writing this?

I am not great with js and trying to learn how to run multiple effects on a single element after each effect is complete. ie increase div height then fade out after a delay.

I would also be interested to see how the code changes if i wanted to run multiple effects at the same time but one thing at a time.

Below code runs fine but I am not sure if I should be doing it that way.

Here is a fiddle im playing with http://jsfiddle.net/kaigan/qr2BJ/

var el = $('system-message-container');
(function(){

el.tween('height', [20, 200]);
})
.delay(2000);

(function(){
el.fade('out').get('tween', {duration: 'long'})
})
.delay(4000);
0

There are 0 answers