I’m using jQuery to capture an event:
$('input').focus(function(e){
console.log( e.pageX, e.pageY );
});
This doesn’t seem to work… any ideas on alternative ways to getting the mouse position?
Help would be great.
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.
You can only get mouse coordinates using mouse events. If you want to capture the position of the mouse, you can use a global
mousemoveevent listener, and store the coordinates in a set of variables, which can later be accessed by thefocusfunction. Example: