如何打开programatically bootstrap移动导航栏?

时间:2016-07-31 22:53:08

标签: javascript jquery css twitter-bootstrap twitter-bootstrap-3

当我点击按钮时,我试图找到打开引导程序移动导航栏的方法。

$("#myCustomBtn").click(function(){
   // Magic code goes here!
});

无所谓我需要使用jQuery。

1 个答案:

答案 0 :(得分:2)

响应式导航栏使用collapse plugin,您可以使用带有href属性的链接,也可以使用导航栏中按钮的data-target属性的按钮。 Here's an example

修改

如果您想通过jQuery进行操作,可以拨打collapse methods.collapse('toggle').collapse('show').collapse('hide')

我更新了example