Element.appear calls Effect.Appear(element) under the covers. Scriptaculous Effects all have a hook method that gets called after the effect has finished animating. I suspect that's what you need to do here. You can't use these extended attributes in the "short-form" method, so you have to do it long-hand:

Effect.Appear('my-element',{afterFinish: function(){
        $('my-element').focusFirstElement();
}});

There's some additional way you can get the element that the Effect is applied to from within the callback using effect.element, but I can't figure it out. Perhaps someone else could add that to this.

Walter

On Sep 22, 2010, at 9:37 AM, Kupido wrote:

What if the first function takes some time to complete and for some
reason I can't chain the methods?

Suppose we have an hidden form and we want to display it and do
something with it (such as setting the focus to the first field or
even something more complex):

$('my-form').appear();
$('my-form').focusFirstElement();

This is just an example but my code is working fine on Firefox and IE
but not on Chrome, Safari and Opera.

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en .


--
You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to