gpt4 book ai didi

jquery - Bootstrap 汉堡包菜单 Jquery

转载 作者:行者123 更新时间:2023-11-28 07:55:45 26 4
gpt4 key购买 nike

我创建了一个 Bootstrap 导航栏并希望它在手机上显示网页时导航栏仍然有效。因为它当前是按钮,所以当您单击它时没有任何反应。我看过代码笔 (http://codepen.io/macsupport/pen/bKFzD),但他们的示例也不起作用。

<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="true" aria-controls="navbar">
<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" >Leeds Market</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="homepage.php">Home</a></li>
<li><a href="about.php">About</a></li>
<li><a href="stalls.php">Stalls</a></li>
<li><a href="products.php">Products</a></li>
<li><a href="basket.php">Basket</a></li>
</ul>
<form class="navbar-form navbar-right" method="post" action="loginsql.php" >
<div class="form-group">
<input type="text" placeholder="Username" name="Username" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" name="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
<a href="register.php" class="btn btn-success" role="button">Register</a>
<a href="traderlogin.php" class="btn btn-success" role="button">Trader</a>
</form>
</div><!--/.navbar-collapse -->
</div>
</nav>

最佳答案

将这些包含在 <head> 中你的页面:

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

关于jquery - Bootstrap 汉堡包菜单 Jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30124268/

26 4 0