In my Rails application I have flash messages and I would like it so that each time there is a flash message, it scrolls down from the top (all the content goes lower) stays for a few seconds and the slides back up.
How can I do this with jQuery?
Do I toggle the height?
Update
Sometimes the message will be injected into the HTML which means that the slideDown
won't work since the DOM has already loaded, how can I have it so jQuery looks for .message
and then applies the slideDown
and slideUp
?