I'm having similar problems. My code dynamically switches out the content of the tab as a user switches from one task to another.
First, it destroys the existing tabs:
- while ( $("#tabs").tabs("length") > 0 ) { $("#tabs").tabs("remove",$("#tabs").tabs("length")-1); }
Then it runs a script similar to the above to generate a new set of tabs.
What I've noticed is that the more I switch between tasks, the more extra containers appear.
To try to combat this problem, I've added the following cleanup function after I remove the existing tabs and before adding the new ones:
- $( "div[id^='ui-tabs-']" ).remove();
I had to apply a similar set of cleanup functions to remove dialog boxes from the old tab set.
The net result is that only one "extra" div exists at any one time. However, I've also noticed that when I mass-add tabs, all the tab containers appear (as blanks, mainly) until I click another tab and the hiding system can initialize itself.