Please watch the video as I go through the problem I’m having. The navbar won’t collapse when I select the link in mobile view.
Asked
Active
Viewed 125 times
-1
-
It wouldn't allow me to add links to my code. – Rawad Merhi Apr 28 '15 at 04:30
-
@KenY-N http://codepen.io/rawadm/pen/waBpye – Rawad Merhi Apr 28 '15 at 04:35
-
see on the portfolio it collapse as soon as you select a link? I apologies if my explanation wasn't the best.http://rawadmerhi.com/ – Rawad Merhi Apr 28 '15 at 04:44
-
change it to mobile view and select a link you will see the navbar collapsing. – Rawad Merhi Apr 28 '15 at 04:57
-
Ahh, I finally see what you mean; however, this [appears to be a feature](https://github.com/twbs/bootstrap/issues/12852). – Ken Y-N Apr 28 '15 at 05:57
1 Answers
1
Looking at the answers in this question, and playing about with your fiddle, the following seems to fix the problem:
<li class="current"><a href="#home" data-toggle="collapse" data-target=".navbar-collapse.in">Home </a></li>
<li><a href="#about" data-toggle="collapse" data-target=".navbar-collapse.in">About</a></li>
<li><a href="#contact" data-toggle="collapse" data-target=".navbar-collapse.in">Contact</a></li>
See the updated fiddle here.
-
@Thanks, you mentioned that .navbar-collapse.in is a feature in Bootstrap?@Ken Y-N – Rawad Merhi Apr 28 '15 at 13:09