Forum: Ruby on Rails RJS Queue

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Brandon S. (Guest)
on 2006-04-03 21:40

I've been able to succesfully queue page.visual_effect commands in my
RJS templates.  Each command will wait to execute until the previous
command is done executing.

But I'd also like to execute a page.replace_html command AFTER the
page.visual_effect commands.  I have a series of five DIVs:


When the user clicks on div1, a page.visual_effect command is executed
in div1 disappears.  At this point, I want to execute a
page.replace_html command on my divs.  Right now, the visual_effect and
replace_html execute in parallel, so you never see the visual_effect
take place.

Can anyone help me with this?

Thanks in advance!

Charlie B. (Guest)
on 2006-04-03 21:46
(Received via mailing list)
I hope I'm wrong, but I don't think that can be done without writing
your own javascript. I've asked the same question multiple times but no
answer.  Could you post your queued visual effects code.  I haven't
tried to do that with rjs yet.
Brandon S. (Guest)
on 2006-04-03 21:57

Check out this page for details:

All I had to do was add the :queue => 'end' parameter to the end of my
visual_effect commands.  I hope this helps.

Sergei S. (Guest)
on 2006-04-03 22:08
Hi Brandon,

Effects have events you can use to syncronize your other code with them.

For example:

new Effect.BlindDown('customer_edit', {
afterFinish: function(element){alert('You can see it now');}

Event names are beforeStart, beforeSetup, beforeUpdate, beforeFinish and
their 'after' mates.

Charlie B. (Guest)
on 2006-04-03 22:26
(Received via mailing list)
Thank you! I've been trying to figure out how to do this but to no
Brandon S. (Guest)
on 2006-04-03 22:30
Thanks Sergei.  I'll try it out.
This topic is locked and can not be replied to.