So, like the question specifies, is there a way to trigger a mousemove event in jQuery which also sends the mouse coordinates to the event Object?
So far my code can
This is the best I could come up with, that doesn't inolve you setting global variables. The click event will still capture the coordinates, so you can pass that event to your mousemove.
$(element).click(function(e){
$(element).trigger('mousemove',e);
});
Then, that event object will be the second argument in your mousemove function; the first being either the actual mousemove event or the jQuery created event.
$(element).mousemove(function(e,clickEvent){
if typeof e.pageX === 'undefined' e = clickEvent;
// or if you prefer, clickEvent.pageX;
});