CakePHP: remove cakePHP Flash messages using JQuery

Typically you would have all the cakePHP flash messages inside the div - alert_messages.

By using JQuery, we can remove these after intended time period.
The following example removes the cakePHP flash message after 5 seconds time period.

$(document).ready(function() {
  $('#alert_messages').animate({opacity: 1.0}, 5000).fadeOut();  
});

2 comments:

  1. Nice Solution...
    This is what i was exactly looking for.It has made my day...

    ReplyDelete
  2. Superb ! very useful post. Thank you so much!

    ReplyDelete

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...