我有一个使用谷歌地图和设置在一系列标记上的信息框的小应用程序。单击信息框图像后,您将转到另一个链接。这在 Pc 和我的 Ipad 上完美运行,但是当您在 Android(三星手机)中点击图像时,链接不是“活动的”。以下是部分代码:
var myOptions = {
content: boxText
,disableAutoPan: true
,maxWidth: infobox_width
,boxClass:"mybox"
,zIndex: null
,closeBoxMargin: "-13px 0px 0px 0px"
,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
,infoBoxClearance: new google.maps.Size(1, 1)
,isHidden: false
,pane: "floatPane"
,enableEventPropagation: true
};
infoBox = new InfoBox(myOptions);
for (var i = 0; i < locations.length; i++) {
var beach = locations[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadow,
icon: custompin(beach[8]),
shape: shape,
title: beach[0],
zIndex: beach[3],
image:beach[4],
price:beach[5],
type:beach[6],
type2:beach[7],
link:beach[9],
infoWindowIndex : i
});
gmarkers.push(marker);
google.maps.event.addListener(marker, 'click', function() {
infoBox.setContent('<div class="info_details" id="strut"><a href="'+this.link+'">'+this.image+'</a> <h2><a href="'+this.link+'">'+this.title+'</a></h2> <div class="prop_details"><span class="info_inside">'+this.type+' for '+this.type2+' - '+this.price+'</span></div>' );
infoBox.open(map, this);
map.setCenter(this.position);
if(infobox_width==700){
map.panBy(380,-190);
}else{
map.panBy(0,-190);
}
});
我还尝试列出 infobox 的 domready 事件,但没有运气:
google.maps.event.addListener(infoBox,'domready',function(){
jQuery('#strut').click(function(){ alert('clicked!') });
});