"E-commerce Navigation using Bootstrap 4"
Bootstrap 4.1.1 Snippet by Umerfarooq

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 ---------->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/boxicons@2.0.2/css/boxicons.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"></script>
<div class="overlay"></div>
<div class="utility-nav d-none d-md-block">
<div class="container">
<div class="row">
<div class="col-12 col-md-6">
<p class="small"><i class="bx bx-envelope"></i> logo@example.com | <i class="bx bx-phone"></i> +92-1234567890
</p>
</div>
<div class="col-12 col-md-6 text-right">
<p class="small">Free shipping on total of $99 of all products</p>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-expand-md navbar-light bg-light main-menu" style="box-shadow:none">
<div class="container">
<button type="button" id="sidebarCollapse" class="btn btn-link d-block d-md-none">
<i class="bx bx-menu icon-single"></i>
</button>
<a class="navbar-brand" href="#">
<h4 class="font-weight-bold">Logo</h4>
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
.btn .bx {
vertical-align: inherit;
margin-top: -3px;
font-size: 1.15rem;
}
.form-control {
height: calc(2.5rem + 2px);
padding: 0.5rem 1.5rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.3rem;
}
.btn {
font-size: 1rem;
padding: 0.5rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
}
.bx.icon-single {
font-size: 1.5rem;
}
.form-inline .form-control {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.form-inline .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
/* Small devices (landscape phones, 576px and up) */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$(document).ready(function() {
$("#sidebarCollapse").on("click", function() {
$("#sidebar").addClass("active");
});
$("#sidebarCollapseX").on("click", function() {
$("#sidebar").removeClass("active");
});
$("#sidebarCollapse").on("click", function() {
if ($("#sidebar").hasClass("active")) {
$(".overlay").addClass("visible");
console.log("it's working!");
}
});
$("#sidebarCollapseX").on("click", function() {
$(".overlay").removeClass("visible");
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: