Skip to content

kaspernj/bootstrap-tabs-dynamic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

A framework for adding, remove, renaming and in general handling Twitter Bootstrap Tabs through JavaScript.

@nick322 has set up this exelent JS Fiddle: jsfiddle.net/0ua2gzyc/

Require the single JavaScript file.

tabs = $("ul.nav-tabs")
tabs.addBSTab("id_of_tab", "Tab title", "<b>Content</b>")

You can also add it by an element already defined (maybe as hidden?):

tabs.addBSTab("id_of_tab", "Tab title", $("#my_element_id"))
tab = tabs.getBSTabByID("id_of_tab")
tab.removeBSTab()
tab = tabs.getBSTabByID("id_of_tab")
tab.renameBSTab("New title")
a.click(function(){
  tab = $(this).currentBSTab()
})
a.click(function(){
  tab_id = $(this).currentBSTabID()
})

About

A small plugin in order to be able to add, remove and edit bootstrap tabs dynamically.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors