2014-07-04 80 views
-1

我想在谷歌地图标记信息窗口上设置一些显示/隐藏动作。我这样做是通过mouseovermouseout事件,但我已经使用jQuery所以有些冲突......,代码:谷歌地图信息窗口显示/隐藏动作

newmarker['infowindow'] = new google.maps.InfoWindow({ 
    content: html 
}); 

google.maps.event.on(newmarker, { 
    mouseover : function(){ 
     this['infowindow'].open(map, this) 
    }, 
    mouseout : function() { 
     this['infowindow'].close(map, this) 
    } 
}); 

有人能帮忙吗?

+0

它的工作或没有? – cracker

回答

2

尝试像

google.maps.event.addListener(marker, 'mouseover', function() { 
    infowindow.open(map, this); 
}); 

// assuming you also want to hide the infowindow when user mouses-out 
google.maps.event.addListener(marker, 'mouseout', function() { 
    infowindow.close(); 
}); 

Demo

Demo1

+0

好的,但如何将其设置为一个事件监听器? – Lukas

+0

你可以直接使用它 – cracker

+0

thx寻求帮助,它的工作完美,对不起,但没有反应,但只是2天我看到它 – Lukas