这里是一个Javascript jQuery的顺序如何从可折叠引导改变3 navbar
到不可折叠navbar
:
// Grab the height of the navbar
var navbarHeight = $('.navbar-header').height();
// Remove the navbar-toggle button
$('.navbar-toggle').remove();
// Move the collapsed section into the navbar-header
$('.collapse').appendTo('.navbar-header');
// Display all the collapsed items inline (assumes all the items are list items)
$('.collapse, .collapse ul, .collapse li').css('display', 'inline-block');
// Remove collapse class
$('.collapse').removeClass('collapse');
// Remove navbar-nav class (optional)
$('.navbar-nav').removeClass('navbar-nav');
// Hard-set the height of the navbar (optional)
$('.navbar-header').height(navbarHeight);
注意上面的序列只被测试有几种类型的导航栏元素。它可能需要您的导航栏的附加步骤。
我添加了一个问题的澄清 - 我想在导航栏上看到这些项目,而不是在它下面的下拉列表中。 –