Bootstrap 4 Responsive Megamenu Example

Bootstrap 4 Responsive Megamenu Example:
Megamenu is one of the most important feature and need for ecommerce and business websites. There are lot of mega menu samples and examples for bootstrap 3. Since the bootstrap 4 came up with major changes, you can not use those examples/samples to make mega menu with bootstrap 4.
Bootstrap 4 cheat sheet with all the classes are shared in the below link,

Bootstrap 4 all classes list – Cheat Sheet

I am sharing the bootstrap 4 responsive megamenu below using yamm css.

Bootstrap 4 Responsive Megamenu Example:

[html]
<!DOCTYPE html>
<html lang=”en”>
<head>
<!– Required meta tags –>
<meta charset=”utf-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”>

<!– Bootstrap CSS –>
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css” integrity=”sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ” crossorigin=”anonymous”>

<!– Yamm styles–>
<link href=”css/yamm.css” rel=”stylesheet”>

<!– Demo styles–>
<link href=”css/demo.css” rel=”stylesheet”>

</head>
<body>
<nav class=”navbar fixed-top navbar-toggleable-md navbar-inverse bg-primary yamm” id=”slide-nav”>
<button class=”navbar-toggler navbar-toggler-left” type=”button” data-toggle=”collapse” data-target=”#navbarTopMenu” aria-controls=”navbarTopMenu” aria-expanded=”false” aria-label=”Toggle navigation”>
<span class=”navbar-toggler-icon”></span>
</button>
<div class=”container”>
<a class=”navbar-brand” href=”#”>Javadomain</a>
<div class=”navbar-brand”>
</div>
<div class=”collapse navbar-collapse” id=”navbarTopMenu”>
<ul class=”navbar-nav mr-auto mt-2 mt-md-0″>
<li class=”dropdown yamm-fw nav-item active”><a href=”#” class=”nav-link” data-toggle=”dropdown”>Mega Menu 2×6</a>
<ul class=”dropdown-menu”>
<li class=”grid-demo”>
<div class=”row”>
<div class=”col-sm-6″><br>
<h3>6</h3><br>
</div>
<div class=”col-sm-6″><br>
<h3>6</h3><br>
</div>
</div>
</li>
</ul>
</li>

<li class=”dropdown yamm-fw nav-item active”><a href=”#” class=”nav-link” data-toggle=”dropdown”>Mega Menu 4×3</a>
<ul class=”dropdown-menu”>
<li class=”grid-demo”>
<div class=”row”>
<div class=”col-sm-4″><br>
<h3>4</h3><br>
</div>
<div class=”col-sm-4″><br>
<h3>4</h3><br>
</div>
<div class=”col-sm-4″><br>
<h3>4</h3><br>
</div>
</div>
</li>
</ul>
</li>

<li class=”dropdown yamm-fw nav-item active”><a href=”#” class=”nav-link” data-toggle=”dropdown”>Mega Menu 3×4</a>
<ul class=”dropdown-menu”>
<li class=”grid-demo”>
<div class=”row”>
<div class=”col-sm-3″><br>
<h3>3</h3><br>
</div>
<div class=”col-sm-3″><br>
<h3>3</h3><br>
</div>
<div class=”col-sm-3″><br>
<h3>3</h3><br>
</div>
<div class=”col-sm-3″><br>
<h3>3</h3><br>
</div>
</div>
</li>
</ul>
</li>

<li class=”dropdown yamm-fw nav-item active”><a href=”#” class=”nav-link” data-toggle=”dropdown”>Mega Menu 6×2</a>
<ul class=”dropdown-menu”>
<li class=”grid-demo”>
<div class=”row”>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
<div class=”col-sm-2″><br>
<h3>2</h3><br>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!–/.container inside nav–>
</nav>
<div class=”container” style=”margin-top:5rem;”>
<h1>Bootstrap 4 Responsive MegaMenu Example</h1>
<h2> Click above Mega menu’s to see the mega menu </h2>
</div> <!–/. container –>
<!– jQuery first, then Tether, then Bootstrap JS. –>
<script src=”https://code.jquery.com/jquery-3.1.1.slim.min.js” integrity=”sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n” crossorigin=”anonymous”></script>
<script src=”js/tether.js”></script>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js” integrity=”sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn” crossorigin=”anonymous”></script>

<script>
$(function() {
window.prettyPrint && prettyPrint()
$(document).on(‘click’, ‘.yamm .dropdown-menu’, function(e) {
e.stopPropagation()
})
})
</script>

</body>
</html>
[/html]

 

Bootstrap 4 Responsive Megamenu Live Demo:

download

 

Leave a Reply