/ Published in: JavaScript
URL: http://www.lupaworld.com/89596/viewspace_32961.html
Expand |
Embed | Plain Text
var mouseX = 0; var mouseY = 0; $().mousemove( function(e) { mouseX = e.pageX; mouseY = e.pageY; });
Comments
Subscribe to comments
You need to login to post a comment.

or so:
var mouseX = mouseY = 0; $().mousemove(function(e) { mouseX = e.pageX; mouseY = e.pageY; });
To understand how it works and learn more about getting mouse positions with jQuery read this article here:
http://jquery-howto.blogspot.com/2009/07/identifying-locating-mouse-position-in.html
It explains the above jquery code snippet and gives some more examples.