"Hamburger"
Bootstrap 4.0.0 Snippet by websterchannel

1
2
3
4
5
6
7
8
9
10
11
12
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="menu">
<span class="line one"></span>
<span class="line two"></span>
<span class="line three"></span>
</div>
</div>
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
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
height: 100vh;
background-color: #e3f2fd;
}
.container{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 80px;
width: 90px;
border-radius: 6px;
background-color: #fff;
box-shadow: 0 5px 10px rgba(0,0,0,0.15);
display: flex;
justify-content: center;
cursor: pointer;
transition: all 0.4s linear;
overflow: hidden;
}
.container.active{
background-color: #fecd03;
}
.container .menu{
position: relative;
height: 100%;
width: 65px;
display: flex;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
let hamMenu = document.querySelector(".container");
hamMenu.addEventListener("click", () => {
hamMenu.classList.toggle("active");
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: