So I want to be able to trigger my mousemove function in jquery using $().mousemove(), but I want to also be able to pass the current mouse state as a parameter, so my mousemove function knows the mouse x and y coordinates.
I understand that a possible workaround is just to save the x and y coordinates and create a function that directly uses these coordinates, but I wanted to know if there was a way to just get the current mouse event.
Example:
$(document).mousemove(function(e) {
var x = e.pageX;
var y = e.pageY;
// do stuff with x and y
});
function trigger_mousemove() {
$(document).mousemove(/** here is where I want something to be able to put in */);
}
Thanks in advance!