Change Bootstrap navbar theme

Asked

Viewed 72 times

2

Hello,

I searched a lot on the internet a method that I can change the theme of the Bootstrap navbar by clicking a button.

Navbar when the user accessed the site:

When the user clicked on the button:

Grateful from now on.

1 answer

3


You can use the class navbar-inverse that makes the effect you seek.

Assemble an event headset that removes this class on the first click.

An example would be like this:

$('.navbar-inverse').on('click', function(){
    $(this).removeClass('navbar-inverse');
});

Example: https://jsfiddle.net/7q6chbsL/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.