0

我按照我观看的教程中的所有说明进行操作,但响应式菜单没有展开?甚至下拉菜单也不起作用。当我单击按钮时,什么也没发生,它只是改变了它的颜色。我可能做错了什么?

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head      content must come *after* these tags -->
<title></title>

<!-- Bootstrap -->
 <link href="view/css/bootstrap.min.css" rel="stylesheet">
<link href="view/css/styles.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="view/js/bootstrap.min.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
    <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="#"><img src="view/images/logo.png">
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
              <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">The Institution <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="">About the Institute</a></li>
                <li><a href="">Research & Programs</a></li>
                <li><a href="">Board of Advisers</a></li>
                <li><a href="">Educational Quality Team</a></li>
              </ul>
              </li>
              <li><a href="#">The Center</a></li>
              <li><a href="#">Opportunity</a></li>
              <li><a href="#">Get In Touch</a></li>

            </ul>
        </div>  
 </div></div>

JS

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>

4

2 回答 2

1

它现在可以工作了我刚刚编辑了这部分

JS

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

并删除了除此之外的所有内容

<script src="js/respond.js"></script>

感谢所有回答的人!:)

于 2015-05-02T02:46:48.673 回答
0

bootstrap.js 包含两次,一次是在加载 jQuery 之前。消除

<script src="view/js/bootstrap.min.js"></script>

在你的头部

于 2015-05-01T17:09:25.667 回答