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 }