Re: Two RJS visual effects will happen at the same time?

pepe
Tue, 25 May 2010 14:37:09 -0000

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

On May 24, 9:26 am, Jian Lin
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:
> 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 }
> --
> Posted viahttp://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.