嘿伙计我有一个rails应用程序通过railsassets设置引导程序,我有一个会扩展但不会在切换时崩溃的导航栏。从我在这里读到的解决方案是从在线来源托管js,但我已经这样做了。这是代码:
<!DOCTYPE html>
<html>
<head>
<title>Cable Blade: Cut Your Cable Bill</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <!-- Bootstrap -->
<link href="/assets/application-3c8a5eb3858888951e26c6d071a21305.css" media="screen" rel="stylesheet" />
<script src="/assets/application-6c4abb164efadf56cf17347c4d676b7b.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body style="background-color:#f3f3f3;text-align:center;color:000000;">
<!-- CONTENT -->
<div class="container-fluid">
<!-- NAV -->
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<!-- Brand & Toggle grouped for mobile device -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" 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" href="/">Cable Blade</a>
</div>
<!-- Collect nav links for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div><!-- navbar-collapse -->
</div><!-- container-fluid -->
</nav>
<!-- END NAV -->
</div>
<!-- END CONTENT -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</body>
</html>
非常感谢任何帮助。