/ Published in: Rails

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
## application.haml #notices{:style => 'display:none;'}= flash[:notice] ## application.js // every page reload document.observe("dom:loaded", function() { show_notices() }) // notices var show_notices = function () { if (!$('notices').empty()) { $('notices').appear( { duration: 3, from: 0, to: 1, queue: 'front' } ) $('notices').fade( { duration: 3, from: 1, to: 0, queue: 'end' } ) } }
Comments
