87,984
社区成员
发帖
与我相关
我的任务
分享
for (var i = 0; i < 3; i++) {
......
google.maps.event.addListener(marker[i], 'click', function() {
alert(i);
infowindow[i].open(map,marker[i]);
});
......
}
google.maps.event.addListener(marker[1], 'click', function() {
alert(1);
infowindow[1].open(map,marker[1]);
google.maps.event.addListener(marker[2], 'click', function() {
alert(2);
infowindow[2].open(map,marker[2]);
google.maps.event.addListener(marker[3], 'click', function() {
alert(3);
infowindow[3].open(map,marker[3]);