I was wondering is there a way I can have my page display a delete message after the php code has done the deletion and then have Jquery fade out the message after about 5 seconds. If so how would my JQuery code look like? An example would help me out.
this does not seem to work when I click my delete button and my php code refreshes the page?
maximum
2010-09-24 16:58:13
+1
A:
Yep. If your message has an ID of 'delete-message' then you can use the following code:
$(function() {
setTimeout(function() {
$('#delete-message').fadeOut();
},5000);
});
That will set a timeout of 5 seconds once the page has loaded, and after that 5 seconds, it will fade out the element with the ID 'delete-message'.
Richard
2010-09-24 17:06:59
I think you can do `$('#delete-message').delay(5000).fadeOut();` instead of using `setTimeout`.
strager
2010-09-24 17:50:59