These answers aren't correct. Bootstrap has a built-in simple way to do this, the same way it handles the collapse for the top menu.
Add the class navbar-default
to the nav
element. It will collapse without this class, but you won't have the little expand icon (the three horizontal lines that you click to expand).
Add the classes navbar-collapse collapse
to the inner div which contains the links that should collapse.
Add <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
before your div that should collapse.
This will come out rather messy trying to cut and paste my 3 steps above; what I did was literally copy and paste those sections from my working navbar at the top, then paste them in one by one. Those 3 elements are what you need, though: navbar-default, navbar-collapse, and the button.