汉堡菜单折叠问题

时间:2017-05-30 14:28:20

标签: twitter-bootstrap collapse hamburger-menu

当我用汉堡包菜单点击第三个项目(“Opere”)时,它正确折叠但下一个项目(“Contatti”)不会在项目下滚动。为什么呢?

http://www.simonenicosia.it/demo/

[enter image description here]

<nav id="main-nav">
      <ul id="navbar-submenu">
        <li><a href="index.php">Home</a></li>
        <li><a href="#profilo">Profilo</a></li>
        <li><span data-toggle="collapse" data-target="#toggleOpere" data-parent="#navbar-submenu" class="collapsed">Opere</span>
          <div class="collapse" id="toggleOpere" style="height: 0px;">
            <ul class="nav nav-list">
              <li><a href="#"id="projects/pittura.html" class="project-expander">Pittura</a></li>
              <li><a href="#"id="projects/evoluzioni.html" class="project-expander">Evoluzioni pittoriche</a></li>
              <li><a href="#"id="projects/3d.html" class="project-expander">Forme tridimensionali</a></li>
              <li><a href="#"id="projects/steel.html" class="project-expander">Steel</a></li>
              <li><a href="#"id="projects/artdesign.html" class="project-expander">ArtDesign</a></li>
              <li><a href="#"id="projects/musticatower.html" class="project-expander">MusticaTower</a></li>
              <li><a href="#"id="projects/unstoppable.html" class="project-expander">Unstoppable spirit</a></li>
            </ul>
          </div>
        </li>
        <li><a href="#contatti">Contatti</a></li>
      </ul>
      <a href="#" class="cd-close-menu">Chiudi<span></span></a>
    </nav>

1 个答案:

答案 0 :(得分:1)

您已指定li的高度,这会阻止子菜单在单击时展开。您可以将其更改为最小高度。

#main-nav li {
    height: 15%;
}
#main-nav li {
    height: 20%;
}

更改为:

#main-nav li {
    min-height: 15%;
}