如何隐藏Thickbox中的loadingAnimation.gif...?
我是 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”在厚盒上始终可见,即使在谷歌地图完全加载之后也是如此。
I'm new to jQuery Thickbox. I've implemented the following code:
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);
}
The issue is the 'loadingAnimation.gif' always visible on the thickbox, even after the google map gets completely loaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用以下 CSS 删除加载消息(以便它根本不显示):
您也可以选择通过
随时调用脚本来删除它。
You can remove the loading message (so that it doesn't show at all) with the following CSS:
optionally, you can remove it through script by calling
whenever you want.
看起来很奇怪,但更改
为
使其对我有用。
Seems strange, but changing
to
makes it work for me.
我很确定谷歌地图代码与此无关。最好的方法是根本不显示加载程序(将其从 Thickbox 代码中删除)或在停留初始化后隐藏 loading.gif。
我对 Thickbox 不太熟悉。但它应该有一个回调。使用它隐藏 gif(或其容器)。
I'm pretty sure the Google Maps code has nothing to do with it. The best methods would be to not display the loader at all (remove it from the Thickbox code) or to hide the loading.gif after the layover has initialized.
I'm not that familiar with Thickbox. But it should have a callback. Use that hide the gif (or it's container).