Possible Duplicate:
Reset JavaScript Counter?
I’m trying to create a function that will trigger another function 5seconds after an event, as long as another event isn’t triggered.
Whenever an event is triggered it sets var timeout to 5000. What is the best way to count down and trigger another function if this value isn’t reset before it hist 0?
Something like this?
Edit: oops. my bad