我是 jQuery Thickbox 的新手。我已经实现了以下代码:
HTML:
<a class="thickbox" href="javascript:void(0);" onclick="javascript:initMap(lat,lng,'htmlmsg',1);" >map</a>
<div id="show_map" style="display:none">
<div id="map_canvas"></div>
</div>
JS:
function initMap(x,y,msg,flg){
var map = new GMap2(document.getElementById("map_canvas"),{size: new GSize(400,380)});
map.removeMapType(G_SATELLITE_MAP);
map.removeMapType(G_HYBRID_MAP);
var point = new GLatLng(x, y);
var htmlMsg = msg;
map.setCenter(point, 14);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
var baseIcon = new GIcon();
baseIcon.shadow = "";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
baseIcon.infoShadowAnchor = new GPoint(18, 25);
var letteredIcon = new GIcon(baseIcon);
letteredIcon.image = "http://www.google.com/intl/en_ALL/mapfiles/marker.png";
markerOptions = { icon:letteredIcon };
var marker = new GMarker(point,markerOptions);
GEvent.addListener(marker, "mouseover", function() {
map.openInfoWindowHtml(point, htmlMsg);
});
map.addOverlay(marker);
if (flg==1){
map.openInfoWindowHtml(point, htmlMsg);
}
tb_show('Quick view','#TB_inline?height=400&width=400&inlineId=show_map',true);
}
问题是“loadingAnimation.gif”始终在厚盒上可见,即使在谷歌地图完全加载后也是如此。