Google Maps Infowindow没有按原样显示选项卡 [英] Google maps infowindow not showing the tabs as it should

查看:178
本文介绍了Google Maps Infowindow没有按原样显示选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几周前,我在信息窗口中显示了选项卡. 现在不再显示了...

i had the info windows showing the tabs just fine a few weeks ago.. and now its not showing anymore...

实际上,代码使用JQuery.在此链接上找到代码

In fact the code uses JQuery.. find the codes on this link http://code.google.com/p/gmaps-samples-v3/source/browse/trunk/infowindow/tabs.html?r=78

我已经包括了JQuery的所有库,包括CSS文件. 怎么了?... 让我感到困惑的是,它已经工作了一段时间,突然停了下来.实际上发生了什么??

I have included all the libraries of JQuery including the CSS files.. what is wrong?... what puzzles me is that it was working for quite a while and suddenly stopped..what actually happened??

任何帮助将不胜感激:)

Any help would be appreciated:)

推荐答案

如果您还没有弄清楚,或者对于其他可能遇到相同问题的人...

If you haven't figured it out yet, or for others that might be having the same issue...

这似乎是一个计时问题. $(#tabs").tabs()在创建tabs元素/可见/不管之前被调用.通过将事件侦听器添加到"domready"来激活选项卡,一旦将内容实际添加到DOM就会触发该事件侦听器.

It appears to be a timing issue. $("#tabs").tabs() is being called prior to the tabs elements being created/visible/whatever. Activate the tabs by adding an event listener to "domready" which is fired once the content is actually added to the DOM.

google.maps.event.addListener(marker, 'click', function () {
    infowindow.open(map, marker);

    google.maps.event.addListener(infowindow, 'domready', function () {
        $("#tabs").tabs();
    });
});

这篇关于Google Maps Infowindow没有按原样显示选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆