Hi,
How can I force the tabs plugin to re-initialize? I am trying to dynamically add tabs depending on user actions, but I cannot figure out how to get the tab/pane added via script to register properly. I am modifying jasonpinder's original post from here:http://flowplayer.org/tools/forum/25/39097
I start with something like this:
Then I do the tabs
I don't think it matters, but my tabs are also in an jquery tools overlay.
Now when I do:
I get the tab added in and I can click it, but when I click a different tab the new tab3 keeps the "current" class and the pane3 does not get display:none; and stays visible underneath the opened tabs.
Here are some picture links to demonstrate (I got rid of the content in the tabs so it is easier to look at):
This is how they are originally created
http://img339.imageshack.us/i/tabsinitial.png/
This is after creating the third tab
http://img230.imageshack.us/i/tabsdynamicadded.png/
This is after opening the third tab and then opening another one
http://img197.imageshack.us/i/tabsbroken.png/
How can I force the tabs plugin to re-initialize? I am trying to dynamically add tabs depending on user actions, but I cannot figure out how to get the tab/pane added via script to register properly. I am modifying jasonpinder's original post from here:http://flowplayer.org/tools/forum/25/39097
I start with something like this:
<div id="tabdiv">
<ul class="tabs">
<li>
<a href="#">
tab1
</a>
</li>
<li>
<a href="#">
tab2
</a>
</li>
</ul>
<div class="panes">
<div>
pane1
</div>
<div>
pane2
</div>
</div>
</div>
Then I do the tabs
$("#tabdiv ul.tabs").tabs("div.panes > div");
I don't think it matters, but my tabs are also in an jquery tools overlay.
Now when I do:
$("#tabdiv ul.tabs").removeData("tabs");//without this, the tab isn't clickable
$("#tabdiv ul.tabs").append('<li><a href="#">tab3</a></li>');
$("#tabdiv div.panes").append('<div>pane3</div>');
$("#tabdiv ul.tabs").tabs("div.panes > div");
I get the tab added in and I can click it, but when I click a different tab the new tab3 keeps the "current" class and the pane3 does not get display:none; and stays visible underneath the opened tabs.
Here are some picture links to demonstrate (I got rid of the content in the tabs so it is easier to look at):
This is how they are originally created
http://img339.imageshack.us/i/tabsinitial.png/
This is after creating the third tab
http://img230.imageshack.us/i/tabsdynamicadded.png/
This is after opening the third tab and then opening another one
http://img197.imageshack.us/i/tabsbroken.png/
