This is working : http://jsfiddle.net/9NDXF/1/ when I write onmousemove, but this is not : http://jsfiddle.net/9NDXF/7/ when I write onscroll.
How can I have the mouse position onscroll ?
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.
Because the scroll event has no pageX property. Scrolls suck. Here’s a nice article on mouse scroll events, and a jsFiddle of the demo.
The only way to “get the mouse position on scroll” is to have recorded it at some earlier time, then access it when needed. I would put a lot of thought into why you think this is a good idea first though: jsFiddle