GMaps v3: addDomListener mouseenter event handling not working on Chrome, Safari

Is this a bug in the google maps API?

If I use the prototype library to add the mouseenter, and mouseleave event handlers, it works just fine. But if I use addDomListener, it doesn't work. Although it works in Firefox, the event handling function never gets called in Chrome or Safari.

Answers


Use the Maps API for adding event handlers to the Map, or other API objects.

Example with Map Enter/Out:

google.maps.event.addListener(map, "mouseover", function() {
  // Mouse Entered the Map
});

google.maps.event.addListener(map, "mouseout", function() {
  // Mouse Left the Map
});

Maps API Reference Guide - Scroll to Events for the Map to See All Map Event Options


Need Your Help

Doesn't JavaScript Minification hurt open source?

javascript open-source minify

There's an awful lot on the web these days about how important it is to minify your JavaScript. Speed is all that matters.

Extract last tagName of various Selectors

javascript regex css-selectors

Basically I attempting to extract the last tag name of a handful of different css selectors.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.