如何隐藏Thickbox中的loadingAnimation.gif...?

发布于 2024-08-03 19:20:55 字数 1721 浏览 10 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

北陌 2024-08-10 19:20:55

您可以使用以下 CSS 删除加载消息(以便它根本不显示):

#TB_load img { display: none !important; }

您也可以选择通过

document.getElementById('TB_load').style.display = "none"

随时调用脚本来删除它。

You can remove the loading message (so that it doesn't show at all) with the following CSS:

#TB_load img { display: none !important; }

optionally, you can remove it through script by calling

document.getElementById('TB_load').style.display = "none"

whenever you want.

蓝天 2024-08-10 19:20:55

看起来很奇怪,但更改

<a class="thickbox" href="javascript:void(0);" onclick="..." >map</a>

<a class="thickbox" href="#" onclick="..." >map</a>

使其对我有用。

Seems strange, but changing

<a class="thickbox" href="javascript:void(0);" onclick="..." >map</a>

to

<a class="thickbox" href="#" onclick="..." >map</a>

makes it work for me.

酒与心事 2024-08-10 19:20:55

我很确定谷歌地图代码与此无关。最好的方法是根本不显示加载程序(将其从 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文