[英]How do I know infowindow has already popped up in google maps
I want to display some animation on infoWindow in google maps with jQuery. 我想在google地图中使用jQuery在infoWindow上显示一些动画。
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. animation()
必须通过infoWindow上的id获取元素,因此infoWindow必须在执行animation()
之前完成加载。
How can I execute animation()
immediately afer infoWindow finish loading instead of waiting 1 second every time? 如何在infoWindow完成加载后立即执行
animation()
而不是每次等待1秒?
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
//do something
});
if(infowindow.getMap()){// TODO:}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.