I would like to be able to detect if the mouse is still over the element in the following scenario:
- If mouseover then sleep for a few seconds.
- Once done sleeping check of the mouse is still over the same element.
- If true then do something.
How can I achieve #2?
Thank you.
Take a look at the hoverIntent plugin for jQuery. It gives you a new event handler which will fire only if you have been hovering over an element for a certain amount of time. By tweaking its options, you should be able to get it to do exactly what you want.