当我缩小页面时,导航栏的大小会适当缩小,但导航折叠按钮不起作用。我无法看到我的代码有任何问题。
为什么这段代码可以在这里或JSFiddle上运行,但不能在使用IE或Chrome的本地机器上运行?
(JSFiddle)
<html>
<head runat="server">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>My Library <small>A library for people who like libraries.</small>
</h1>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<nav class="navbar navbar-default navbar-inverse" role="navigation">
<div class="container-fluid" id="navfluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigationbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navigationbar">
<ul style="width: 100%" class="nav navbar-nav navigationList">
<li id="homeListItem" class="active">
<a href="home.aspx">Home</a>
</li>
<li id="libraryListItem">
<a href="library.aspx">Library</a>
</li>
<li id="aboutUsListItem">
<a href="aboutus.aspx">About Us</a>
</li>
<li id="contactListItem">
<a href="contact.aspx">Contact</a>
</li>
<li id="loginListItem">
<a href="login.aspx">Login</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
</body>
</html>
&#13;
答案 0 :(得分:-1)
看起来像是“scripts / boostrap.js”的拼写错误,应该是“scripts / bootstrap.js”。