Google Maps Infobox和jQuery [英] Google Maps Infobox and jQuery
问题描述
我正在使用信息框显示一些与标记有关的数据.数据包含html代码,尤其是包含test
类的div.
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
.
奇怪的是,我似乎无法访问此html代码,因为以下代码不起作用:
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");
});
我正在强调这样一个事实,确切的代码可以与InfoWindow一起正常工作.我还可以确认显示了完整的html,就像我使用FireBug看到的一样.
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.
我知道live()
已被贬值,但我使用的是旧版jQuery.
I know that live()
has been depreciated but I am using and older jQuery version.
任何人都可以帮忙吗?
Can anyone help please?
推荐答案
知道了!
我必须在InfoBox选项中设置enableEventPropagation:true.
I had to set enableEventPropagation: true in the InfoBox options.
谢谢!
这篇关于Google Maps Infobox和jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!