2
我想在jquery ui选项卡中使用Openlayers,但出现错误:“size is null”!jquery ui tabs中的Openlayers
我想在jquery ui选项卡中使用Openlayers,但出现错误:“size is null”!jquery ui tabs中的Openlayers
有同样的问题。这在jquery tabs和problems-with-google-maps-api-v3-jquery-ui-tabs解释。
我所做的:在我的jQuery-UI-1.7.1.custom.css(最近的是1.8.2)找到行:
.ui-tabs .ui-tabs-hide { display: none !important; }
并将其更改为:
.ui-tabs .ui-tabs-hide { position: absolute;
left: -10000px; }
我做了什么:
// 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");