I tried first of all this code:
[code]
tabbarHome = new dhtmlXTabBar(‘a_tabbar’, ‘top’);
tabbarHome.attachEvent(“onSelect”, function(id) {
if (id == “a1”) { tabbarHome.forceLoad(‘a1’); }
});
tabbarHome.setSkin(‘default’);
tabbarHome.setImagePath(‘dhtmlxSuite/dhtmlxTabbar/codebase/imgs/’);
tabbarHome.addTab(‘a1’, ’ Elenco Contratti ', ‘*’);
tabbarHome.enableTabCloseButton(true);
tabbarHome.setHrefMode(‘iframes-on-demand’);
tabbarHome.setContentHref(‘a1’, ‘<? echo $url; ?>ElencoContratti.php’);
tabbarHome.setTabActive(‘a1’);
function add(nomeTab) {
var id = (new Date()).valueOf();
tabbarHome.addTab(id, nomeTab+’ ‘, ‘*’);
tabbarHome.setContentHref(id, nomeTab.replace(/ /g, “”)+’.php?idTab=’+id);
tabbarHome.setTabActive(id);
}
[/code]but the content of the “a1” tab was invisible.
Then I tried to move the attachEvent function at the end, as you can see on this code:
[code]
tabbarHome = new dhtmlXTabBar(‘a_tabbar’, ‘top’);
tabbarHome.setSkin(‘default’);
tabbarHome.setImagePath(‘dhtmlxSuite/dhtmlxTabbar/codebase/imgs/’);
tabbarHome.addTab(‘a1’, ’ Elenco Contratti ', ‘*’);
tabbarHome.enableTabCloseButton(true);
tabbarHome.setHrefMode(‘iframes-on-demand’);
tabbarHome.setContentHref(‘a1’, ‘<? echo $url; ?>ElencoContratti.php’);
tabbarHome.setTabActive(‘a1’);
tabbarHome.attachEvent(“onSelect”, function(id) {
if (id == “a1”) { tabbarHome.forceLoad(‘a1’); }
});
function add(nomeTab) {
var id = (new Date()).valueOf();
tabbarHome.addTab(id, nomeTab+’ ‘, ‘*’);
tabbarHome.setContentHref(id, nomeTab.replace(/ /g, “”)+’.php?idTab=’+id);
tabbarHome.setTabActive(id);
}
[/code]But, when I add a new tab, this doesn’t became active (refer to the add function) and, even if I click on the new tab, this doesn’t became active.
Any other suggestion??? I think the solution is not far…