Faustino Luna Montaner Faustino Luna Montaner - 5 months ago 23
Javascript Question

How to open programatically bootstrap mobile navbar?

I'm trying to discover the way to open the bootstrap mobile navbar when a button is clicked.

// Magic code goes here!

No matters is I need to use jQuery.


The responsive navbar uses the collapse plugin, you can use a link with the href attribute, or a button with the data-target attribute of the button in your navbar. Here's an example


If you want to do it via jQuery you can call the collapse methods: .collapse('toggle'), .collapse('show') or .collapse('hide')

I updated the example.