1

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 2

2

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'.

Sign up to request clarification or add additional context in comments.

1 Comment

I think you can do $('#delete-message').delay(5000).fadeOut(); instead of using setTimeout.
0

you can do this using document ready funtion


$(document).ready(function(){
    setTimeout(function() {
        $('#delete-message').fadeOut();
      alert('test');
    },3000);
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.