Hi again,

I understand what you want, but the problem this time is that you
are dealing with several elements.
When calling invoke, it is just as if you were looping on each item of your
Enumerable and calling the invoked method for each of them, with all
parameters - that is to say with afterFinish callback for each of them. In
other words, afterFinish callback will be called for each item being fade.
your function will be called after each fade which is not what you want.

The only solution I can think about is to loop on your items, build an array
of effects with the sync option, then run the array of effects using an
Effect.Parallel which will be the only one with an afterFinish:

var effects = [];
$$(".solution").each( function(item) {
  effects.push( new Effect.Fade(item, {sync: true}));
});
new Effect.Parallel(effects, afterFinish:  function() {
  search( area, choice, Enumerable.invoke.curry("appear").bind(
$$('solution') ) )
});


On Tue, Apr 6, 2010 at 5:27 PM, C_B <i...@christian-baesler.de> wrote:

> Hi,
>
> yes you are. I already had the problem described.
>
> In fact, the following works fine:
>
>    <a href="#" onclick="$$('.solution').invoke('fade',{ duration:
> 0.8, from: 1, to: 0 });">Fade</a>
>    <a href="#" onclick="$$('.solution').invoke('appear',{ delay:
> 0.35 });return false;">Appear</a>
>
> All elements of the class solution fade and appear at the same time,
> not one after another.
> Now I want to do the following using a function:
>
> 1. fade all elements of the class solution synchronously (like in the
> "a href" above)
> 2. run owned function search(area, choice) which sets some cookies and
> does some AJAX changing content of all elements of the class
> "solution"
> 3. appear all elements of the class solution synchronously (like in
> the "a href" above)
>
> I have alredy tried doing this by using queues but it does not work -
> as described in my first post, all tasks were done synchronously .
> Now, your version works fine with IDs. So i hope, it also fits to
> elements of classes.
>
> Hope you get me?
>
>
> Cheers!
>
> --
> 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<prototype-scriptaculous%2bunsubscr...@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