dropdown menu muncul setelah di klik 2 kali

saya punya nav menu yang saya dapatkan dari bootstrap v-4, namun saya mengalami beberapa kendala yaitu, dropdown akan muncul ketika saya mengklik menunya 2 kali, hal ini terjadi setelah refresh halaman.

<header>
  <nav class="navbar navbar-expand-lg navbar-light navbar-header fixed-top bt-warning p-2" id="navbar">
    <div class="container">
      <a class="navbar-brand mt-1" href="#">
        <img src="<?php echo base_url()?>assets/dist/img/AdminLTELogo.png" width="40" height="40" class="d-inline-block align-top" alt="">
        <p class="t-titlepage d-inline-block mt-1">Perpustakaanku</p>
      </a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse n-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active">
            <a class="nav-link font-weight-bold" href="#">Home <span class="sr-only">(current)</span></a>
          </li>
          <li class="nav-item">
            <a class="nav-link font-weight-bold" href="#">Link</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              Dropdown
            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
              <a class="dropdown-item" href="#">Action</a>
              <a class="dropdown-item" href="#">Another action</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="#">Something else here</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle font-weight-bold" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              <i class="fas fa-user"></i> Akun
            </a>
            <div class="dropdown-menu  dropdown-menu-right alert-warning" aria-labelledby="navbarDropdown1">
              <a class="dropdown-item d-flex justify-content-between align-items-center" href="#">Login <i class="fas fa-sign-in-alt"></i></a>
              <a class="dropdown-item d-flex justify-content-between align-items-center" href="#">Register <i class="fas fa-file-alt"></i></a>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </nav>
</header><!-- /header -->
avatar waziat
@waziat

23 Kontribusi 5 Poin

Dipost 3 tahun yang lalu

Tanggapan

JS nya ada gan?

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban