移动的导航菜单在Bootstrap 5.3.0和jQuery 3.7.0中不塌陷

btxsgosb  于 12个月前  发布在  Bootstrap
关注(0)|答案(1)|浏览(155)

我试图当在移动的视图中,我点击汉堡图标的导航栏列表(菜单,关于,奖项和电话号码)出现和消失时,再次点击.但什么也没有发生,每当我点击图标.我使用Bootstrap 5.3.0和jquery 3.7.0,我也用过这个代码
data-toggle=“collapse”data-target="#discoverable-nav”删除bs,因为它在bootstrap 5中被更改,并且它不工作。有人可以帮助我吗?

body {
  font-size: 16px;
  color: #fff;
  background-color: #61122f;
  font-family: 'Oxygen', serif;
  overflow: auto;
}

nav a {
  text-decoration: none;
}

#header-nav {
  background-color: #f6b319;
  border-radius: 0;
  border: 0;
}

#logo-img {
  background: url('../images/restaurant-logo_large.png') no-repeat;
  width: 150px;
  height: 150px;
  margin: 10px 15px 10px 0;
}

#Navbar-1 {
  float: right;
}

#pqp {
  float: left;
}

.navbar-brand {
  padding-top: 2px;
}

.navbar-brand h1 {
  /* Restaurant name */
  font-family: 'Lora', serif;
  color: #557c3e;
  font-size: 1.5em;
  text-transform: uppercase;
  font-weight: bold;
  text-shadow: 1px 1px 1px #222;
  margin-top: 0;
  margin-bottom: 0;
  line-height: .75;
}

.navbar-brand p {
  /* Kosher cert */
  color: #000;
  text-transform: uppercase;
  font-size: .7em;
  margin-top: 15px;
}

.navbar-brand p span {
  /* Star-K */
  vertical-align: middle;
}

#button {
  position: absolute;
  top: 20px;
  right: 10px;
  @media (min-width: 768px) {
    display: none;
  }
}

#nav-list {
  list-style: none;
}

#nav-list a {
  color: #951C49;
  text-align: center;
  margin-right: 15px;
}

div>ul>li>a:hover {
  display: block;
  background-color: #fff;
}

#nav-list a span {
  font-size: 1.8em;
}

#phone {
  margin-top: 5px;
}

#phone a {
  /* Phone number */
  text-align: right;
  padding-bottom: 0;
}

#phone div {
  /* We Deliver */
  color: #557c3e;
  text-align: right;
  font-size: larger;
  padding-right: 15px;
}

.navbar-header button.navbar-toggle,
.navbar-header .icon-bar {
  border: 1px solid #61122f;
}

.navbar-header button.navbar-toggle {
  clear: both;
  margin-top: -30px;
}

个字符

20jt8wwn

20jt8wwn1#

问题是缺少启动rap类navbar-expand-lg,并删除**#可扩展导航的类d-none和d-md-block**

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

字符串
修复了fiddle中的代码

相关问题