Bootstrap 3.0菜单在移动的设备上不起作用

7uhlpewt  于 2022-12-07  发布在  Bootstrap
关注(0)|答案(1)|浏览(261)

我在bootstrap 3.0中发现了一个问题,即当菜单折叠时导航菜单不工作。要查看示例,请转到此处:http://apexenergetics.azurewebsites.net/
我开始觉得可能是我的Javascript文件丢失了。我在iPhone5和iPad上测试了这个网站。在浏览器中浏览时,它运行正常。
更新:它似乎在Windows Phone上工作得很好。而且,只有带有下拉菜单的项目才不起作用。没有下拉菜单的链接/按钮才起作用。

<header>
        <div class="row">
            <div class="col-xs-12 col-md-6">
                <img src="@Href("~/img/logo.png")" alt="Apex Energetics">
            </div>
            <div class="col-xs-12 col-md-6">
              @*<form class="form-search">
          <input type="text" class="input-medium search-query" placeholder="Search Apex Energetics">
          <button type="submit" class="search-btn" >Search</button>
            </form>*@
            </div>
        </div>

      <!-- Static navbar -->
      <div class="navbar">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="@Href("~/index")">Home</a>
          </div>
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apex Complexes <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/K-Line_Formulas")">K-Line Formulas</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/K-plex")">&nbsp;&nbsp;&#187;K-Line Nutritionals</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/K-Line_Creams")">&nbsp;&nbsp;&#187;K-Line Creams</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/K-Line_Homeopathics")">&nbsp;&nbsp;&#187;K-Line Homeopathics</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/Z-plex")">TerrainZyme&reg; Formulas</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/L-plex")">Cellegion Formula&reg;</a>
                  </li>
                </ul>
              </li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Homeopathics <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/antitox")">Antitox&reg;</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/A-plex")">&nbsp;&nbsp;-B-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/B-plex")">&nbsp;&nbsp;-B-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/C-plex")">&nbsp;&nbsp;-C-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/D-plex")">&nbsp;&nbsp;-D-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/E-plex")">&nbsp;&nbsp;-E-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/N-plex")">&nbsp;&nbsp;-N-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/W-plex")">&nbsp;&nbsp;-W-Plex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/S-plex")">Allertox</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/R-plex")">RegenRx</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/G-plex")">Metaboplex</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/M-plex")">Endotox</a>
                  </li>
                  <li class="dropdown-toggle">
                    <a href="@Href("~/products/flowers")">Flower Combinations</a>
                  </li>
                </ul>
              </li>
              <li><a href="@Href("~/products/purvela")">Purvela&trade;</a></li>
              <li><a href="@Href("~/pages/contact")">Contact Us</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
</header>
rxztt3cl

rxztt3cl1#

对我有用。有一个问题,Bootstrap 3的下拉菜单有时在触摸屏上不起作用。如果这是你的问题,你可以像这样瞄准你的折叠下拉按钮...
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {}
...并为移动的上的下拉菜单添加单独的功能。

相关问题