This is a migrated thread and some comments may be shown as answers.

Example of dynamically adding/removing Tabs

1 Answer 1066 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 23 Oct 2015, 03:43 PM

My goal here is to be able to dynamically add and remove tabs.  I'd like to use a close icon on the tab to trigger the removal.  A special plus tab at the end would be used to add new tabs.  The jsfiddle below is my attempt to do this but I'm noticing the content is getting mixed with the tabs as they're being removed.  Can anyone help with what I'm doing wrong or perhaps suggest a better approach?  Thanks.

http://jsfiddle.net/kturner75/o0g4e5ct/

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 23 Oct 2015, 08:11 PM

Ok, I found an example of where closest function was used to find the tab li element to use for remove.  That fixed the problem.

http://jsfiddle.net/kturner75/o0g4e5ct/

Tags
TabStrip
Asked by
Kevin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Share this question
or