Created
December 16, 2008 15:13
-
-
Save ryanahamilton/36626 to your computer and use it in GitHub Desktop.
Pretty flash errors and notices that fade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#notice { | |
border: solid 1px #99cc99; | |
background-color: #e2f9e3; | |
color: #006600; | |
padding: 5px; | |
margin-bottom: 5px; | |
} | |
#notice.error { | |
border-color: #cc0000; | |
background-color: #eeaaaa; | |
color: #cc0000; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if flash[:error] || flash[:notice] %> | |
<%= content_tag :div, flash[:error] || flash[:notice], :id => 'notice', :class => ('error' if flash[:error]) %> | |
<script type="text/javascript"> | |
setTimeout("new Effect.Fade('notice');", 1000) | |
</script> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment