Openlayers inside jquery ui tabs

2020-06-27 01:50发布

I want to use Openlayers inside jquery ui tabs but I get error: "size is null"!

2条回答
可以哭但决不认输i
2楼-- · 2020-06-27 02:18

What's i have done :

// Get hidden tabs content
var $cache = $(".ui-tabs-hide");

// Make them visible
$cache.removeClass("ui-tabs-hide");

// Initialize your map here
...

// Re-hide the tabs content
$cache.addClass("ui-tabs-hide");
查看更多
做个烂人
3楼-- · 2020-06-27 02:29

Had the same problem. It's explained at jquery tabs and problems-with-google-maps-api-v3-jquery-ui-tabs.

What I did: in my jquery-ui-1.7.1.custom.css (most recent is 1.8.2) find the line:

.ui-tabs .ui-tabs-hide { display: none !important; }

and change it to:

.ui-tabs .ui-tabs-hide { position: absolute;
        left: -10000px; }
查看更多
登录 后发表回答