"Burger Menu - JB"
Bootstrap 4.1.1 Snippet by jaybaheliya

<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 ----------> <div class="menucontainr"> <div id="mymenu"> <span> </span> <span> </span> <span> </span> <span> </span> </div> </div>
body { background: #333; } .menucontainr { margin: 200px auto; width: 100px; position: relative; } #mymenu { display: block; cursor: pointer; transition: all ease-in-out 0.5s; } #mymenu span { padding: 5px; display: block; margin-bottom: 15px; background: #fff; width: 100px; height: 14px; top: 0; position: relative; transition: all ease-in-out 0.5s; } .menucontainr .open span:nth-child(2), .menucontainr .open span:nth-child(3) { opacity: 0; width: 0 !important; transition: all ease-in-out 0.5s; } .menucontainr .open span:nth-child(1) { transform: rotate(45deg); top: 30px !important; transition: all ease-in-out 0.5s; } .menucontainr .open span:nth-child(4) { transform: rotate(-45deg); top: -60px !important; transition: all ease-in-out 0.5s; }
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> <script> $(document).ready(function() { $('#mymenu').click(function() { $(this).toggleClass('open'); }); }); </script>

Related: See More


Questions / Comments: