Navbar下拉Bootstrap不工作

时间:2014-12-12 00:30:01

标签: css twitter-bootstrap drop-down-menu include navbar

我知道这已经被问到了,但我无法根据答案修复它,因为我已经在其他线程中找到了包含。我在bootstrap导航栏中的下拉列表无法正常工作。我觉得很奇怪,因为其他功能,如移动菜单正在工作。我将加入以下代码。谢谢!!

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" />
<META NAME=“Version” CONTENT=“Plano R1” />
    <title>Plano</title>


    <script src="/scripts/jquery-latest.min.js" type="text/javascript"></script>
<script src="/scripts/jquery.jeditable.js" type="text/javascript"></script>
<script src="/scripts/jquery.jeditable.masked.js" type="text/javascript"></script>
<script src="/scripts/jquery.maskedinput-latest.min.js" type="text/javascript"></script>
<script src="/scripts/jquery.autocomplete.js" type="text/javascript"></script>
<script src="/scripts/date.format.js" type="text/javascript"></script>
<script src="/scripts/jquery.floatThead.js" type="text/javascript"></script>
<script src="/scripts/PatientSearch.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui.js" type="text/javascript"></script>

 <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/css/jquery-ui-latest.css">
<link rel="stylesheet" type="text/css" href="/css/iPad.css">
<link rel="stylesheet" type="text/css" href="/css/cms.v2.css">
<link rel="stylesheet" type="text/css" href="/css/css3-buttons.css">
<link rel="stylesheet" type="text/css" href="/css/patients.css">
<link rel="stylesheet" type="text/css" href="/css/appointments.css">
<link rel="stylesheet" type="text/css" href="/css/jquery.autocomplete.css">
<link rel="stylesheet" type="text/css" href="/css/base/jquery.ui.autocomplete.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
 <link rel="stylesheet" href="../dist/css/bootstrap.css">
 <script src="../dist/js/bootstrap.min.js"></script>

</head>
<body>
    <header class="noPrint">

  <nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <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 plano">&nbsp;&nbsp;Plano&nbsp;&nbsp;&nbsp;</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav" role="navigation">
        <li><a href="/agenda/agenda.php"><span class="icon icon33"></span><span class="">Agenda</span></a></li>
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">R&eacute;pertoires<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="/providers/">Fournisseurs</a></li>
            <li><a href="/patients/">Patients</a></li>
            <li><a href="/professionals/">Professionels</a></li>
          </ul>
        </li>
        <li><a href="/tasks/inactives.php"><span class="icon icon120">T&acirc;ches</a></li>
        <li><a href="/settings/status.php?table=patient"><span class="icon icon96">R&eacute;glages</a></li>
        <li><a href="/patients/dispos.php" onclick="popUp(this.href,'console',600,435);return false;" target="newWin" id="dispo-link">Disponibilit&eacute;s</a></li>
        <li><a href="#" id="add-link"><span class="icon icon3">Patient</a></li>
        <li><a href="/logout.php"><span class="icon icon151">D&eacute;connexion</a></li>
      </ul>
      <form class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" id="searchboxappointment" name="searchboxappointment" placeholder="Rechercher un patient" class="form-control searchboxappointment searchengine "  size="35" value="<?php  echo isset($_POST['searchboxappointment']) ? $_POST['searchboxappointment'] : "";?>" />
        </div>
      </form>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

</header

2 个答案:

答案 0 :(得分:2)

你加载了2个版本的jQuery。摆脱1.11.0版本。

 <script src="/scripts/jquery-latest.min.js" type="text/javascript"></script>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

答案 1 :(得分:0)

我将您的代码添加到codepen中。 HERE li这似乎对我有用。也许你的问题出在其他地方。

您是否检查过这些CDN资源是否实际为您提供了他们的图书馆,甚至是否在线与您的网站连接?是否在离线模式下关闭服务器?如果是,CDN引用将无法连接。

我会在你的root中保存那些CDN引用。它们非常适合测试目的,但它们并不是永久性资源。如果他们的服务器出现故障,您的网站也将关闭。更不用说,如果您需要,您无法修改其中的代码。