Something like…
$('.foo').live 'click', ->
setTimeout (()->$(this).parent().hide()), 5000
Thanks for any help!
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.
this in setTimeout is going to be either
windowor undefined. In this case, you’d be better off either wrapping with an anonymous function to close over this, or using bind(this) to bind the this object for the functionor
(I don’t know coffeescript very well, so hopefully this is the proper JS equivalent)
As a sidenote, doesn’t jquery have a function to delay a animation like this?