【问题标题】:GMaps v3: addDomListener mouseenter event handling not working on Chrome, SafariGMaps v3:addDomListener mouseenter 事件处理在 Chrome、Safari 上不起作用
【发布时间】:2013-05-01 17:45:30
【问题描述】:

这是 google maps API 中的错误吗?

如果我使用原型库添加 mouseenter 和 mouseleave 事件处理程序,它就可以正常工作。 But if I use addDomListener, it doesn't work. 虽然它在 Firefox 中有效,但在 Chrome 或 Safari 中永远不会调用事件处理函数。

【问题讨论】:

    标签: javascript google-maps google-maps-api-3 dom-events


    【解决方案1】:

    使用 Maps API 将事件处理程序添加到 Map 或其他 API 对象。

    地图输入/输出示例:

    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

    【讨论】:

    • 好的,这些是我正在寻找的事件。不知道我是如何让他们与 mouseenter 和 mouseleave 混淆的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-17
    • 1970-01-01
    • 2022-10-01
    • 2016-10-02
    • 2014-10-12
    相关资源
    最近更新 更多