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(); });
Similar Code Snippets:
I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences.
I truly enjoy what I’m doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.