Two RJS visual effects will happen at the same time?

I was going to change the background of a div from white to red and then
from red back to white, so this is used in an RJS file:

page[:vote_score].visual_effect :highlight, :startcolor => ‘#ffffff’,
:endcolor => ‘#ffcccc

page[:vote_score].visual_effect :highlight, :startcolor => ‘#ffcccc’,
:endcolor => ‘#ffffff

But looks like they happen at the same time, instead of one after
another. Is there a way to make it happen one after another?

the Javascript sent to the browser is:

try {
$(“vote_score”).update(“Score 63”);
$(“vote_score”).visualEffect(“highlight”,
{“endcolor”:"#ffcccc",“startcolor”:"#ffffff"});
$(“vote_score”).visualEffect(“highlight”,
{“endcolor”:"#ffffff",“startcolor”:"#ffcccc"});
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());
alert(’$(“vote_score”).update(“Score
63”);\n$(“vote_score”).visualEffect(“highlight”,
{“restorecolor”:"#ffcccc",“endcolor”:"#ffcccc",“startcolor”:"#ffffff"});\n$(“vote_score”).visualEffect(“highlight”,
{“endcolor”:"#ffffff",“startcolor”:"#ffcccc"});’); throw e }

On May 24, 2:26 pm, Jian L. [email protected] wrote:

But looks like they happen at the same time, instead of one after
another. Is there a way to make it happen one after another?

The visual_effect takes a queue option, read something like
http://script.aculo.us/docs/EffectQueues.html to understand how effect
queues work etc.

Fred

I found Ajax on Rails, from O’Reilly, to be an excellent book, if it’s
any help.