How to detect that user have done nothing for ‘X’ minute and run function on this event?
E.G.
if( // no action from user for 'X' minutes) { //do stuff } ??
Any suggestion much appreciated.
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.
Live Demo
Like everyone else has stated use
setTimeoutand set it to the desired amount of time to wait. If there is any activity just clear the timeout usingclearTimeout.