-
-
Save rgo/332945 to your computer and use it in GitHub Desktop.
Snippet to hide flash messages automagically with jQuery
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
<%# From pretty_flash by rpheath (improved by pacoguzman) %> | |
<% if flash.any? -%> | |
<script type="text/javascript"> | |
$(function() { | |
setTimeout(hideFlashes, 5000); | |
}); | |
var hideFlashes = function() { | |
$("[id^='flash_']").fadeOut(1500); | |
} | |
</script> | |
<% end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment