I'm using jquery Tools tabs and would like to disable a particular tab (e.g. current tab), sometime after it has been initialized, e.g. on button click.
This is the code that I have now, which does work, but I'm wondering whether there are better solutions.
Imagine I have a "disable" button that runs this:
//disable all tabs except for current tab
$("ul.tabs").tabs("div.panes > div", function(ev,index){
if (index != this.getIndex()){
return false;
}
})
and then an "enable tabs" button that does this:
$("ul.tabs").tabs("div.panes > div") //enables all tabs (by not disabling any)
The problem is, if I'm not mistaken, that I'm reinitializing the tabs each time, instead of modifying an the original existing instance. Is there a better solution?