Search code examples
htmlcsstwitter-bootstrapresponsivehamburger-menu

Bootstrap hamburger menu isn't working on phone


I have tried to find the issue, but nothing works for me.

If I am resizing the browser the hamburger menu wil pop up and work, but when I take a look on my phone it doesn't work. Did I really do something wrong?

The code I am using:

HTML:

    <nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" 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>
      <a class="navbar-brand" href="#">Roy van Eerden</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">
        <li class="active"><a href="#about">Home</a></li>
        <li><a href="#skills">Portfolio</a></li>
        <li><a href="#experience">Over</a></li>
        <li><a href="#contact">Contact</a></li>
      </ul>
    </div>
  </div>
</nav>

You can see it live at: www.royvaneerden.com/

Screenshot of the phone example: Phone example


Solution

  • Just Place jquery.js above bootstrap.min.js

    also, add meta in head

    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
    

    Check here

    enter image description here