我如何知道infowindow已经在谷歌地图中弹出 [英] How do I know infowindow has already popped up in google maps
问题描述
var infoWindow = new google.maps.InfoWindow 我想在google地图上用jQuery在infoWindow上显示一些动画。 ({
content:contentString
});
google.maps.event.addListener(marker,'click',function(){
infoWindow.open(map,marker);
setTimeout(animation,1000);
});
animation()
必须获取元素它的id在infoWindow上,所以infoWindow必须在 animation()
执行前完成加载。
我怎样才能在信息窗口完成加载时立即执行 animation()
而不是每次等待1秒?
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow,'domready',function(){
//做某事
});
I want to display some animation on infoWindow in google maps with jQuery.
var infoWindow = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(marker, 'click', function(){
infoWindow.open(map, marker);
setTimeout(animation, 1000);
});
animation()
has to get element by its id on infoWindow, so the infoWindow must finish loading before animation()
is executed.
How can I execute animation()
immediately afer infoWindow finish loading instead of waiting 1 second every time?
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
//do something
});
这篇关于我如何知道infowindow已经在谷歌地图中弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!