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
Think I know your problem. You're trying to query the mouse position programmatically. Perhaps you have code something like this:
$(document).one('mousemove.myModule', function (e) {
// e.pageY and e.pageX is undefined.
console.log('e.pageY: ' + e.pageY + ', e.pageX: ' + e.pageX); }
).trigger('mousemove.myModule');
Then you're absolutely right. The properties pageY and pageX on the event object won't be defined. Actually, there's a hole lot of stuff in the event object that won't be there, not just .pageY and .pageX. Could be some bug in jQuery. Anyways, just don't chain that call to trigger and trigger the event on $(window) instead. Don't ask me why it works though but for me it did:
$(document).one('mousemove.myModule', function (e) {
console.log('e.pageY: ' + e.pageY + ', e.pageX: ' + e.pageX); } );
// Now e.pageY and e.pageX will be defined!
$(window).trigger('mousemove.myModule');