Tell me, please, is it possible to make a navigation bar / set of tabs using bootstrap. so that you can use the script to add or remove tabs in the navigation
1 answer
Maybe. To do with javascript. You need to write a js-code that inserts a new tab, i.e. as a matter of fact to insert into dom html piece. An example is, for example, on so :
http://jsfiddle.net/dogoku/KdPdZ/2/
The implementation of the new tobacco:
function createTab() { var nextTab = $('#tabs li').size()+1; // создание таба $('<li><a href="#tab'+nextTab+'" data-toggle="tab">Tab '+nextTab+'</a></li>').appendTo('#tabs'); // добавляем контент таба $('<div class="tab-pane" id="tab'+nextTab+'">tab' +nextTab+' content</div>').appendTo('.tab-content'); // делаем активным $('#tabs a:last').tab('show'); } |