bootstrap 4移动切换不起作用

时间:2017-08-29 20:28:38

标签: jquery mobile bootstrap-4

  

我有一个bootstrap 3移动导航的工作版本,但我正在尝试   合并bootstrap 4.使用大多数文件的本地版本进行测试   目的。我相信我包含了所有必要的东西,但要切换   手机不工作。 Jquery在所有其他js之前。谢谢!

<head>
<!-- Bootstrap CSS -->
<link href="vendor/bootstrap-4.0.0-beta-dist/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/index.css" rel="stylesheet">
</head>

<body>
<header> 
<nav class="navbar navbar-expand-sm navbar-light bg-faded" role="navigation">

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-content" aria-haspopup="true" aria-controls="nav-content" aria-expanded="false" aria-label="toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">LOGO</a>

<div class="collapse navbar-collapse id="nav-content">

<ul class="navbar-nav">
  <li class="nav-item">
    <a class="nav-link" href="#">Home</a>
  </li>
        <li class="nav-item">
    <a class="nav-link" href="#">Project</a>
  </li>
</ul>
</div>
</nav>    
</header>
<!--Core JS -->
<script type="text/javascript" src="assets/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js">
</script>
<script type="text/javascript" src="assets/js/bootstrap.js"></script>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

onclick="setTimeout(jump, 5000)"

应该是

<div class="collapse navbar-collapse id="nav-content">

确保关闭双引号(使用任何代码编辑器都应该告诉您未公开的双引号。)

&#13;
&#13;
<div class="collapse navbar-collapse" id="nav-content">
&#13;
&#13;
&#13;