I’m trying to show a div thats set to display: none; for 5 seconds with
$('#div').show().delay(5000).hide();
but it deson’t work, it just goes straight to hide()
Can any of you help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do it like this:
By passing in numbers to
.show()and.hide(), jQuery will take those methods into its internal fx queue (even if the number is zero). Since.delay()only works within a queue, you need that little workaround.example: http://jsfiddle.net/zceKN/