Created
July 5, 2011 19:39
-
-
Save jwo/1065693 to your computer and use it in GitHub Desktop.
Drop Down and Fade out Flash Messages
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
/* flash-messages | |
#flash | |
left: 0 | |
margin: 0 auto | |
position: absolute | |
text-align: center | |
top: 0 | |
width: 100% | |
z-index: 1000 | |
.flash,#flash | |
.message | |
text-align: center | |
margin: 0 auto | |
.error,.alert | |
border: 1px solid #fbb | |
background-color: #fdd | |
.warning | |
border: 1px solid #fffaaa | |
background-color: #ffffcc | |
.notice | |
border: 1px solid #1FDF00 | |
background-color: #BBFFB6 | |
.error,.alert,.warning,.notice | |
padding: 1.0em |
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
#flash | |
- flash.each do |key, value| | |
.message{ :class => key } | |
%p= value |
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
$("#flash").fadeIn(function() { | |
fadeOut = function() { | |
$("#flash").fadeOut(); | |
}; | |
setTimeout(fadeOut, 3000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment