I'm looking for a way to recreate the effect used by stackoverflow to display information about badges awarded etc to users, except I want to use the effect to display my fl开发者_开发问答ash messages.
In case it's not clear, I'm talking about the way site updates appear at the top of the browser window and stack there until the user clicks the X button although I won't mind if the messages disappear when the user refreshes the page.
I know this is not technically 'modal'.
Does anyone have any experience of doing this in rails?
use this in your view
<%= render :partial => 'my_custom_flash', :flash => flash %>
and in _my_custom_flash.html.erb
<div id='flash-notice'><%= flash[:notice] %> <%= link_to_function 'Close', visual_effect(:fade, 'flash-notice' %></div>
and you have to set your CSS to make #flash-notice position absolute, with parameters like top:0 and width:100% to make it appear on the top.
I didn't test this code, but it would be my initial approach to solve this
精彩评论