I have two divs that overlap each other completely. The div above is a partially transparent HTML5 canvas, and the parts that are not transparent interact with mouse hovers, clicks, scrolls, etc.
The div below has a map (using leaflet), and similarly it is supposed to interact with hovers, clicks, scrolls, etc.
I can register a click in both divs by having code as follows:
$("#canvas").click(function(e){
$('#map').click();
}
However, in order for my app to work properly, the click event (and all other mouse events) need to register in the identical X-Y position.
All I really need to do is pass e.pageX
and e.pageY
over to the new click function, since the two divs overlap completely (AKA identical 4 corners) - however I am unsure how to do this. Using JQuery (or any other alternative means), how can I register a click in a specific X-Y position in the div #map
?