Google Maps Infobox and jQuery [closed]

白昼怎懂夜的黑 提交于 2020-01-17 03:34:11

问题


I am using infobox to display some data related to the marker. The data contains html code and in particular a div with a class test.

The weird thing is that I cannot seem to access this html code, as the following code does not work:

  $(".test").live("hover", function(){
      alert("hover");
  }); 

I am stressing the fact that the exact code works fine with InfoWindow. I can also confirm that the the complete html shows up, as I can see it using FireBug.

I know that live() has been depreciated but I am using and older jQuery version.

Can anyone help please?


回答1:


Got it!

I had to set enableEventPropagation: true in the InfoBox options.

Thanks!



来源:https://stackoverflow.com/questions/13944058/google-maps-infobox-and-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!