Hey Sava,

Sava Chankov a écrit :
> Effect.Fade(row_id)
> Element .remove(row_id)
> 
> However, it seems that Element.remove is executed in parallel with
> Effect.Fade, so the element disappears without effect. How can an
> element be removed with an effect?

Well, effects are executed asynchronously, so of course your remove call
happens right after the effect *starts*.  Also, you should always invoke
effects using the "new" operator, to ensure proper execution.

If you need to remove the element once the effect is complete, use the
afterFinish callback:

new Effect.Fade(row_id, {
  afterFinish: function() { Element.remove(row_id) }
});

Beware: this won't work in a loop, as row_id will be shared reference.
However, if you need a single call within the scope of declaration of
this row_id variable, you're good to go.

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to