开发者

JQuery tabs no longer showing the tabs

开发者 https://www.devze.com 2023-02-14 17:35 出处:网络
i had the info windows showing the tabs just fine a few weeks ago..and now its not showing anymore...

i had the info windows showing the tabs just fine a few weeks ago..and now its not showing anymore... 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

I have included all the libraries og 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 woul开发者_C百科d be appreciated:)

Here is the updated code:(but it doesn't really work)

google.maps.event.addListener(marker, 'click', function() {
  infowindow.open(map, marker);
  //$("#tabs").tabs();
  setTimeout(function(){
    $("#tabs").tabs();
  }, 100);
});


Here's a work–around:

Change this:

google.maps.event.addListener(marker, 'click', function() {
  infowindow.open(map, marker);
  $("#tabs").tabs();
});

to:

google.maps.event.addListener(marker, 'click', function() {
  infowindow.open(map, marker);
  // Wait for 50ms until converting tabs
  setTimeout(function(){
    $("#tabs").tabs();
  }, 50);
});

You might have to choose a greater value than 50. Seems that the tabs content is available but can't be transformed right away (I'd blame google maps). Better would be to find an event that's triggered once the infowindow has set the content and then call the tabs() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消