I want to animate the div#w_xxx
and the div#w_xxx img
at the same time.
They should get bigger and after this they should get to their old width and height.
The problem is, mootools plays all animations at the same time so I cant see the animation and I tried some .chain
function from mootools but I didnt get it working.
My code looks like this:
$("w_"+current_item+"").set('morph', {
duration: 1000,
transition: Fx.Transitions.Bounce.easeOut
});
$("w_"+current_item+"").morph({
'opacity': '1',
'width': 366,
'height': 240,
'z-index': '100'
});
$$("div#w_"+current_item+" img").set('morph', {
duration: 1000,
transition: Fx.Transitions.Bounce.easeOut
});
$$("div#w_"+current_item+" img").morph({
'opacity': '1',
'width': 366,
'height': 240,
'z-index': '100'
});
$("w_"+current_item+"").set('morph', {
duration: 1000,
transition: Fx.Transitions.Bounce.easeOut
});
$("w_"+current_item+"").morph({
'opacity': '1',
'width': 183,
'height': 120,
'z-index': '100'
});
$$("div#w_"+current_item+" img").set('morph', {
duration: 1000,
transition: Fx.Transitions.Bounce.easeOut
});
$$("div#w_"+current_item+" img").morph({
'opacity': '1',
'width': 183,
'height': 120,
'z-index': '100'
});
You should look at
Fx.Elements
from MooTools-more: http://mootools.net/docs/more/Fx/Fx.Elements, which has been designed to run multiple animations on a unified timer.http://jsfiddle.net/dimitar/tC4V4/
By the same token, it supports link: chain so you can chain things or wait etc.