How do I detect if the mouse has moved over certain co-ordinates of the window, irrespective of scrolling?
It’s for a menu I’m working on. Trying to become better at JavaScript/JQuery…Any help would be greatly appreciated, thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Handle document.mousemove
I believe that e.pageX and e.pageY are what you’re looking for in terms of the whole document.
If those don’t work, try e.clientX and e.clientY, which will tell you where the mouse is in the window, and not the document.