On Friday, July 28, 2006, at 11:05 PM, Eric Boucher
wrote:>Hi,
>
>I want to make a flash[] highlighted for let''s say 5 seconds when
some
>action is invoked.
>
>In the controller, I have:
>flash[:notice] = "error"
>
>In the layout, I have:
><p style="color: white"><%= flash[:notice]
%></p>
>
>I don''t know how to use ajax with the flash. I tried something
like:
>element.highlight(flash[:notice])
>
>without any success. Do I have to put it inside a <div> with an id or
>class? Can somebody help me?
>
>Thanks a lot.
>
>
>
>--
>Posted with http://DevLists.com. Sign up and save your mailbox.
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
I stuck this at the bottom of my ''application.rhtml'' file..
<%= javascript_tag("new Effect.Highlight(''flash'');new
Effect.Fade(''flash'', {duration:10});") if flash %>
This highlights the flash, if there is one, and then it fades out
completely over a longer period.
_Kevin
www.sciwerks.com
--
Posted with http://DevLists.com. Sign up and save your mailbox.