javascript - Hide a div element when I click everywhere inside a map and not on the marker -
sorry basic i'm still learning create basic map program. want hide div element when i'm not clicking on marker. managed show div using click event code:
var marker = new google.maps.marker({ map: map, }); marker.addlistener('click', function(event) { // show div });
just add click event map:
var my_div = document.getelementsbyclassname("custom_div")[0]; var jq_my_div = $('.custom_div'); // jquery google.maps.event.addlistener(map, "click", function(event) { my_div.style.display = 'none'; jq_my_div.hide(); // jquery });
when click on marker - doesnt't react on map click event.
jsfiddle: http://jsfiddle.net/4mtyu/2814/
Comments
Post a Comment