Topic: Animated Rails Flash Messages (with jQuery)

Here's a new blog post detailing a simple way of automagically displaying Rails flash messages via animated fade in/out. This is an unobtrusive approach, that will work in the standard way if Javascript is not present. Uses jQuery for dom access and animations. Hope you enjoy.

http://polyrails.com/2008/11/19/animate … -w-jquery/

Re: Animated Rails Flash Messages (with jQuery)

Why don't you use Prototype? At our video on demand training website you can see an example of it working when you register for instance or add an item to the cart.

Here is the code we use:
<script type="text/javascript">
new Effect.Shake('flash_div');
</script>

It couldn't be any easier.

Then make sure to include the correct javascript files: effects.js and prototype.js

There are many other effects available simply pick the one that suits you best.

Re: Animated Rails Flash Messages (with jQuery)

> It couldn't be any easier.

Gee, I guess one way it could be easier is if it was in English...

Re: Animated Rails Flash Messages (with jQuery)

Here is a JQuery example:

<script type="text/javascript">
  $(document).ready(function(){
  $('#flash').slideDown(1000);});
</script>