Working with google maps which has infowindows that popup. These infowindows have images which are click-able. As a result I need to be able to propagate events in the infowindow. However I am also able to click THROUGH the infowindow to other markers which causes the current infowindow to close and it to open a new infowindow.
I dont think this issue is specific to google maps. Is there a way to stop events from propagating through an element?
Thought the below code would help but it didnt.
$(document).on('touchstart', '.infoWindow', function(e){
if ($(e.currentTarget) == $(this)) e.stopPropagation();
});
.stopImmediatePropagation()could be worth a shot($e.currentTarget) == $(this)check is supposed to do (Btw, it never works, as$eis not defined, and even if it was$(e.currentTarget) == $(this)then it always creates two different jQuery objects)var $ein your code and$eis not a function parameter either. I guess what you really want ise.currentTarget === this.