Bootstrap 4 Multi Level Hover Dropdown Menu – bootnavbar

An awesome Bootstrap 4 multi level hover dropdown menu for your website. The jQuery BootNavbar plugin extends the native Bootstrap 4 navbar into a responsive multi-level dropdown menu.

Plugin Overview

Plugin: bootnavbar
Author: Kamal Pandey
Licence: MIT Licence
Published: February 25, 2019
Repository: Fork on GitHub
Dependencies: jQuery 1.3.1 or Latest version, Bootstrap 4.1.3 and popper.js 1.14.3
File Type: zip archive (HTML, CSS & JavaScript)
Package Size: 4.43 KB

How to Use Multi Level Hover Dropdown Menu:

1. Load the all necessary files into HTML document. Including Bootstrap 4, jQuery, animate CSS and popper JS.

<!--Bootstrap-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">

<!--Animate CSS-->
<link rel="stylesheet" href="https://raw.githubusercontent.com/daneden/animate.css/master/animate.css">

<!--jQuery-->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

<!--Popper Js-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>

<!--Bootstrap 4 Js-->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

2. Include BootNavbar CSS and JS file.

<!--BootNavbar CSS-->
<link rel="stylesheet" href="css/bootnavbar.css">

<!--BootNavbar Js-->
<script src="js/bootnavbar.js"></script>

3. Create HTML structure for multi level dropdwon menu.

<nav class="navbar navbar-expand-lg navbar-light bg-light" id="main_navbar">
   <a class="navbar-brand" href="#">Navbar</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" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
         <li class="nav-item active">
            <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
         </li>
         <li class="nav-item">
            <a class="nav-link" 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>
            <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
               <li><a class="dropdown-item" href="#">Action</a></li>
               <li><a class="dropdown-item" href="#">Another action</a></li>
               <div class="dropdown-divider"></div>
               <li></li>
               <a class="dropdown-item" href="#">Something else here</a>
               <li class="nav-item dropdown">
                  <a class="dropdown-item dropdown-toggle" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  Dropdown
                  </a>
                  <ul class="dropdown-menu" aria-labelledby="navbarDropdown1">
                     <li><a class="dropdown-item" href="#">Action</a></li>
                     <li><a class="dropdown-item" href="#">Another action</a></li>
                     <div class="dropdown-divider"></div>
                     <li></li>
                     <a class="dropdown-item" href="#">Something else here</a>
                     <li class="nav-item dropdown">
                        <a class="dropdown-item dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Dropdown
                        </a>
                        <ul class="dropdown-menu" aria-labelledby="navbarDropdown2">
                           <li><a class="dropdown-item" href="#">Action</a></li>
                           <li><a class="dropdown-item" href="#">Another action</a></li>
                           <div class="dropdown-divider"></div>
                           <li></li>
                           <a class="dropdown-item" href="#">Something else here</a>
                        </ul>
                     </li>
                  </ul>
               </li>
            </ul>
         </li>
         <li class="nav-item">
            <a class="nav-link disabled" href="#">Disabled</a>
         </li>
      </ul>
      <form class="form-inline my-2 my-lg-0">
         <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
         <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
      </form>
   </div>
</nav>

4. Initialize the plugin to active the dropdown menu.

$(function(){
$("#bootnavbar").bootnavbar();
});