I am hacking on something to fix another problem that is a constraint of the system. Not ideal, but..
Anyway, I need to generate a click/touch then find out the topmost element under the poing (300, 300)
. I am using:
event = $.Event( "mousedown", { pageX:300, pageY:300 } );
$("window").trigger( event );
Then I am listening for:
$(window).bind 'mousedown', (jQueryEvent)->
console.log jQueryEvent.target
However, event.target
is always returning window. This makes sense. However, what I am trying to do is generate a mousedown event on the whole page, then use event.target
to find out which element is under the (pageX, pageY)
. Is there a way to do this?