Say I want to queue these JS calls, can that be done with the Rails helpers?
render :update do |page|
page.replace_html replace_html 'notice', flash[:notice]
page.visual_effect :blind_down, "notice", :duration => 0.5
page.visual_effect :blind_up, "notice", :duration => 0.5
end
Thanks.
Scriptaculous effects have a
queueoption, which you can give as a parameter tovisual_effect. For instance,will queue the two effects so that the blind up effect doesn’t start until the blind down finishes.
See Effect Queues on the script.aculo.us github wiki for more information about how queues work and the parameters you can give to queue (for instance, by default, one queue is used for the page, but you can define multiple queues if you want various effect queues to run in parallel).
:queuecan take either a string (as above) or a hash, which lets you have more customization: