I want to use Openlayers inside jquery ui tabs but I get error: "size is null"!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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; }
回答2:
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");