There is the same problem in my case with magnific-popup modal window.
I have landing page with index.php with <?php echo $EM_Event->output(‘#_LOCATIONMAP’); ?> in modal window part of code and file common.js where located all JavaScript code.
You mentionned you had working code:
jQuery(document).bind("em_maps_location_hook", function( e, map, infowindow, marker ){
$("#myID").click(function() {
setTimeout(function() {
google.maps.event.trigger(map, "resize");
infowindow.open(map,marker);
map.setCenter(marker.getPosition());
map.panBy(40,-55);
}, 500);
});
});
I tried to put this code in my common.js. It blocked load of page at all.
Please advice:
1. In what place should I put your code ? In common.js or between <?php><?> tags of index.php or where ever else?
2. What else code and variables should I put for working it correct ? Surely I should define ‘map’. But how can I define it ? Placeholder #_LOCATIONMAP – that is all I know about my map.
3. What is “em_maps_location_hook” and where else should I define it?
Thanks if you can help me.