0

Right now menu uses hover to toggle elements. How can I change hover to mauseclick?

<div id="nav-collapse" class="collapse out">
    <ul class="nav">
        <li class="logo" style="font-size: 25px;"><a href="<{urlpath}>">WEBSITE-NAME</a></li>
        <li>
            <a href="#"><span data-toggle="collapse" data-target="#portfolio-collapse"></span>LINK #1</a>
            <ul id="portfolio-collapse" class="collapse out">
                <li><a href="#">SUB LINK #1</a></li>
                <li><a href="#">SUB LINK #2</a></li>
                <li><a href="#">SYB LINK #3</a></li>
            </ul>
        </li>
...

bootstrap.min.js code on my website (http://wklej.to/OrUbj/text).

4

1 回答 1

0

你的问题和问题不清楚。请编辑您的问题并包含更多详细信息,例如屏幕截图、小提琴链接等。但是,根据 Bootstrap Docs,导航栏下拉菜单适用于点击事件,标记如下:

<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
    <ul class="dropdown-menu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Something else here</a></li>
        <li class="divider"></li>
        <li class="nav-header">Nav header</li>
        <li><a href="#">Separated link</a></li>
        <li><a href="#">One more separated link</a></li>
    </ul>
</li>

如果您想获得响应式菜单,那么您的代码将类似于以下内容:

  <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </a>
  <!-- Everything you want hidden at 940px or less, place within here -->
  <div class="nav-collapse collapse">
    <!-- .nav, .navbar-search, .navbar-form, etc -->
  </div>
于 2013-05-29T11:10:42.350 回答