0

I need add mobile menu toggle to 990px with bootstrap v3.3.7.

This changes my navbar breakpoint. But when I click menu button it shows menu list an instantly collapse back. So menu doesn't stay open after button is clicked.

How can I do to menu stay open after button is clicked?

@media (max-width: 990px) {
    .navbar-header {
        float: none;
    }
    .navbar-toggle {
        display: block;
    }
    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    }
    .navbar-collapse.collapse {
        display: none!important;
    }
    .navbar-nav {
        float: none!important;
        margin: 7.5px -15px;
    }
    .navbar-nav>li {
        float: none;
    }
    .navbar-nav>li>a {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}
cfranco
  • 3,155
  • 5
  • 19
  • 20

2 Answers2

1

I found the solution. It is necessary to add the following class:

.collapse.in{
    display:block !important;
    float: left;
    width: 100%;
}
cfranco
  • 3,155
  • 5
  • 19
  • 20
0

From the fiddle you posted , you should organize it according to bootstrap, and follow there guidelines.

Nikola Kostov
  • 418
  • 1
  • 8
  • 15
  • Thank you Nikola, could you give me an example please? – cfranco Jul 28 '17 at 15:51
  • check this https://stackoverflow.com/questions/18192082/bootstrap-3-navbar-collapse . You are missing this code .navbar-collapse.collapse.in { display: block!important; } on max-width 990px – Nikola Kostov Jul 31 '17 at 11:56