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.
2 Answers
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'.
1 Comment
strager
I think you can do
$('#delete-message').delay(5000).fadeOut(); instead of using setTimeout.