The problem is that you're calling the chain immediately:
var AnimChain = new Chain();
AnimChain.chain(function(){
div.effect('opacity').start(1,0);
AnimChain.callChain(); //this is called immediately, not after the effect
ends
})
When you start an animation, the next line of code is going to be called
immediately. You need to use the animation's chain to delay it as you want;
div.tween('opacity', 1, 0).get('tween').chain(function(){ ...stuff after
the effect...})
On Wed, Dec 10, 2008 at 10:23 AM, Iván N Paz (via Nabble) <
[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> wrote:
> One way would be:
>
> //setup tween
> var tween = $('container').get('tween', {property: 'opacity', duration:
> 400});
>
> //hide it by fading out, chain it to update div, and then show again
> tween.start(0).chain(function(){
>
> //update the faded div´s content
> $('container').grab(....);
>
> //show again
> tween.start(1);
> });
>
>
>
> On Wed, Dec 10, 2008 at 3:46 PM, Oskar Krawczyk <[EMAIL
> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1639920&i=0>>
> wrote:
> >
> > You can always delay the first chain:
> >
> > (function(){this.callChain()}.bind(this)).delay(300);
> >
> > On Dec 10, 2:23 pm, electronbender <[EMAIL
> > PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1639920&i=1>>
> wrote:
> >> I'm trying to do the following:
> >> Fade element out, replace it's HTML, and fade it in again.
> >> So what better way to do this then chain, right?
> >> Well apparently not.
> >> I do it with chain, and there is some flickering when the element re-
> >> appears, rather then have a smooth fade.
> >> Is this happening because of both effects firing at the same time?
> >>
> >> Anyhow, here's the code:
> >> var AnimChain = new Chain();
> >>
> >> AnimChain.chain(function(){
> >> div.effect('opacity').start(1,0);
> >> AnimChain.callChain();
> >> })
> >>
> >> AnimChain.chain(function(){
> >> div.setHTML(msg);
> >> AnimChain.callChain();
> >> })
> >>
> >> AnimChain.chain(function(){
> >> div.effect('opacity').start(0,1);
> >> dl.delay(3000);
> >> })
> >>
> >> AnimChain.callChain();
> >>
> >> var dl = function(){
> >>
> $('StatusInfoWin').effect('top').start(-30,-280);
> >> div.remove();
> >> }
>
>
>
> --
> ◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦
> Iván Núñez Paz | Comunica Online | Tel. 902 945 321
> http://comunicaonline.net/
>
>
>
> ------------------------------
> View message @
> http://n2.nabble.com/Chain-fade%2C-chaning-too-early--tp1638963p1639920.html
> To start a new topic under MooTools Users, email
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>
-----
The MooTools Tutorial: http://www.mootorial.com www.mootorial.com
CNET Clientside: http://clientside.cnet.com clientside.cnet.com
--
View this message in context:
http://n2.nabble.com/Chain-fade%2C-chaning-too-early--tp1638963p1640086.html
Sent from the MooTools Users mailing list archive at Nabble.com.