Mouse position over an element and which element mouse is over?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DanR
    New Member
    • Jan 2012
    • 1

    #1

    Mouse position over an element and which element mouse is over?

    Hi all.

    I'm new to javascript and HTML but I need to find the position of the mouse over an element and am finding it a bit of a headache.

    I've found many solutions and tried some ideas myself but everything I've found either only works in certain browsers, in certain situations (eg. wont work if there are scrolling elements etc.) or the code is huge and just seems ridiculous for such a (apparently not) simple task.

    I only seem to be able to find solutions from several years ago making me think either the problem has been solved and I'm not looking in the right place or these solutions really are the best available.

    Is there really no elegant or simple way of finding the mouse position with javascript without jQuery (I want my page to work offline without an extra download) and if there is, what is it?

    Thanks for reading and for any answer you may have.
    Dan.
Working...