Possible Duplicate:
Get element at specified position - JavaScript
How can I detect the elements at an arbitrary mouse position (x,y)?
I am using mouseenter
/mouseleave
to highlight hovered items. Unfortunately neither of these fire when the mouse moves implicitly and this leads to the wrong item being highlighted. An example of moving the mouse implicitly would be scrolling the page with arrow keys or track pad.
You can see a working demo with comments here: http://jsfiddle.net/bkG2K/6/
My idea for a workaround is to check the mouse's position every so often, or just after scrolling if possible, and update the hover state based on the current mouse co-ordinates. But I'm not sure how I can find DOM elements given an X,Y.
Ideas? If you have a better solution to the root problem, feel free!