Bootstrap 4 Multi Level Hover Dropdown Menu – bootnavbar

Bootstrap 4 Multi Level Hover Dropdown Menu
Code Snippet:bootnavbar
Author: Kamal Pandey
Published: January 11, 2024
Last Updated: January 22, 2024
Downloads: 18,491
License: MIT
Edit Code online: CodeHim
Read More

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.

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();
});

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X