Javascript 如果JQuery UI布局没有显示任何内容,则隐藏北面板

Javascript 如果JQuery UI布局没有显示任何内容,则隐藏北面板,javascript,jquery,jquery-ui,jquery-layout,Javascript,Jquery,Jquery Ui,Jquery Layout,我有一个简单的布局,以北和中心: <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div id="north-main-div"> </div> <div id="center-main-div"> </div> </body> </html> 如果北主id中没有任

我有一个简单的布局,以北和中心:

<html xmlns="http://www.w3.org/1999/xhtml">
    <body>
        <div id="north-main-div">
        </div>
        <div id="center-main-div">
        </div>
    </body>
</html>
如果
北主id
中没有任何内容(无内容),我希望实现整个北部区域不可见,包括切换器。当前,即使没有显示任何内容,切换程序也会显示

如果能给我一些提示来解决这个问题,我将不胜感激


谢谢

我不确定这是不是正确的方法,但它对我很有效

我只是检查它是否为空并调用隐藏函数

topMainLayout = $('body').layout({
    name : 'bodyLayout',
    north__paneSelector : '#north-main-div',
    center__paneSelector : '#center-main-div',
    north__resizabele : false
}); 
if (!$.trim( $('#north-main-div').html() ).length) {
        topMainLayout.hide("north");
} 

不确定这是不是正确的方法,但对我来说很有效

我只是检查它是否为空并调用隐藏函数

topMainLayout = $('body').layout({
    name : 'bodyLayout',
    north__paneSelector : '#north-main-div',
    center__paneSelector : '#center-main-div',
    north__resizabele : false
}); 
if (!$.trim( $('#north-main-div').html() ).length) {
        topMainLayout.hide("north");
}