I wish to do something like as follows:
- When the mouse goes over to some element, record it
- If the mouse stays there for 3 seconds, then execute some action
f()
for that element - If the mouse leaves that element before 3 seconds, then the action should not be executed.
How can I implement this delayed execution with possible cancellation? An answer using DOJO library would be nicer since I am using DOJO toolkit in my project.