closing tabbar

A questions about tabbar.enableTabCloseButton(true):
when I close the active tab, then another tab is not set as “active”…I see an empty content area and no one tab is active. How can I set a tab active when the active one is closed?

Thanks for any reply

With the latest tabbar version after active tab is closed, the next tab is selected (not the previous). So, no tab becomes active only if you close the last tab.

could something like this code work?

if (tabbar.getTabActive() == NULL) {
    tabbat.setTabActive("a1");
}

The method name is wrong. getActiveTab should be instead of getTabActive.

if you want to activate the previous tab when the last one is closed, you may try to use the following:

tabbar.attachEvent("onTabClose",function(id){ var tab = tabbar._tabs[id]; var newTab = tabbar.getNext(tab); if(newTab == tab) tabbar.goToPrevTab(tab); return true })