Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery mouse position on mousedown() without mousemove()

Tags:

jquery

Can I get cursor position at mousedown(event) event, without using mousemove(event) continuously (thus waisting resources)? event.pageX returns NaN on mousedown

like image 499
Jakub M. Avatar asked Aug 05 '11 07:08

Jakub M.


1 Answers

On behalf of James:

from - http://jsfiddle.net/interdream/JsaPG/3/

<input type="button" id="test" value="click" style="width:200px" />

$("#test").mousedown(function(e) {
   console.log(e.pageX); 
});
like image 158
Peter Munnings Avatar answered Sep 27 '22 22:09

Peter Munnings