diff --git a/arduino.html b/arduino.html index 5d8e853..6e612e1 100644 --- a/arduino.html +++ b/arduino.html @@ -776,8 +776,25 @@ ); marker.bindPopup(popup); + mymap.on('popupopen', function() { + setTimeout(function() { + marker.closePopup(); + }, 2000); + }); + + marker.openPopup(); marker.on("mouseover", function(e) { this.openPopup(); }); + + $(document).click(function(e){ + if ($(e.target).is('#map,#map *')){ + return; + } + else{ + //Perform your event operations + marker.closePopup(); + } + });