The problem is pretty straight forward:
$('#btn1').click(function(event){
alert(
"pageX: " + event.pageX +
"\npageY: " + event.pageY
);
});
$('#btn2').mouseout(function(e){
$('#btn1').trigger('click');
});
The second button alerts undefined variables. Is there a way to trigger the click event while passing the mouse positions?
Here is a jsfiddle.
Try this
Just pass the original
event objectthat carries everything.DEMO.
Also you can create a custom
event objectand pass it as followsDEMO.