"Bootstrap 4 Simple Mega menu "
Bootstrap 4.1.1 Snippet by syamacl45

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Megamenu.com</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>
</head>
<body>
<header>
<div class="container custom-width-container">
<nav class="navbar navbar-expand-lg navbar-light bg-white">
<a class="navbar-brand" href="#">LOGO</a>
<button class="navbar-toggler" type="button" data-toggle="slide-collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About Us</a>
</li>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
nav .nav-item.dropdown.megamenu {
position: static !important;
/* width */
/* Track */
/* Handle */
/* Handle on hover */
}
@media (max-width: 991px) {
nav .nav-item.dropdown.megamenu {
position: relative;
}
}
nav .nav-item.dropdown.megamenu .dropdown-divider {
height: 0;
margin: 0.3rem 0;
overflow: hidden;
border-top: 0px;
}
nav .nav-item.dropdown.megamenu .largemenu {
width: 100%;
overflow-y: scroll;
max-height: 350px;
border-radius: 0px;
}
@media (min-width: 991px) {
nav .nav-item.dropdown.megamenu .largemenu {
margin-top: 0px !important;
}
}
nav .nav-item.dropdown.megamenu .largemenu .menu-item {
width: 100%;
}
nav .nav-item.dropdown.megamenu .largemenu .menu-item .dropdown-item {
padding: 0px 1.5rem;
}
nav .nav-item.dropdown.megamenu .largemenu .menu-item .dropdown-item:hover {
color: #f58220;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
jQuery(document).ready(function($) {
// $('[data-toggle="slide-collapse"]').on('click', function () {
// $navMenuCont = $($(this).data('target'));
// $navMenuCont.animate({
// 'width': 'toggle'
// }, 350);
// $(".menu-overlay").fadeIn(500);
// });
// $(".menu-overlay").click(function (event) {
// $(".navbar-toggler").trigger("click");
// $(".menu-overlay").fadeOut(500);
// });
$('[data-toggle="slide-collapse"]').on('click', function() {
$navMenuCont = $($(this).data('target'));
$navMenuCont.animate({
'width': 'toggle'
}, 350);
$(".menu-overlay").fadeIn(500);
});
$('[data-toggle="dropdown"]').after('<span class="down-arrow"></span>');
$(".menu-overlay").click(function(event) {
$(".navbar-toggler").trigger("click");
$(".menu-overlay").fadeOut(500);
});
var windowWidth = $(window).width();
if (windowWidth > 991) {
$('ul.navbar-nav li.dropdown').hover(function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
$('ul.navbar-nav li.dropdown-submenu').hover(function() {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: