"sidebar navigation using simple jquery"
Bootstrap 4.1.1 Snippet by juned_shaikh

<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 href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;1,100;1,300;1,400;1,500&display=swap" rel="stylesheet"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> <div class="main-wrapper"> <div class="black-overlay"></div> <div class="container-fluid"> <div class="row"> <h2 class="sub-head">Sidebar Navigation</h2> <div class="sidebar-panel"> <div class="row"> <div class="col-sm-6"> <button class="opennav"> <i class="fa fa-bars menu-icon fa-2x" aria-hidden="true"></i> </button> </div> <div class="col-sm-6"> <button class="closeing"> <i class="fa fa-times menu-icon fa-2x" aria-hidden="true"></i> </button> </div> </div> <div class="col-sm-12"> <div class="sidelistwrp"> <ul> <li>Home</li> <li>About</li> <li>Work</li> <li>Portfolio</li> <li>Tesitmonial</li> <li>Blog</li> <li>Contact</li> </ul> </div> </div> </div> <div class="side-content"> <hr> <h2>What is Lorem Ipsum?</h2> <p>Here I have design the navigation with simple jquery add and remove class enjoy it.</p> <p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <hr> </div> </div> </div> </div>
.main-wrapper{ width:100%; margin:0 auto; text-align:center; font-family: 'Roboto', sans-serif; position:relative; } button{ background:none; border:none; } .menu-icon{ color:#fff; } .opennav{ position:fixed; left: 20px; top: 40px; outline:none; transition:ease 0.8s; } .closeing{ float:right; padding-right: 20px; transition:ease 0.8s; } .opennav:focus { outline:none; } .closeing:focus { outline:none; } .sidebar-panel.activate{ margin-left:0px; transition:ease 0.8s; } .sidebar-panel.unactivate{ margin-left:-300px; transition:ease 0.8s; } .black-overlay.dark{ background:#000; z-index:99; position:fixed; top:0; height:100%; width:100%; opacity:0.5; } .sub-head{ text-align:center; width: 100%; font-weight:500; color:#fff; padding:40px 0 30px; text-transform:uppercase; font-size:2em; background:#000; } .sidebar-panel{ background:#337ab7; width: 300px; position: fixed; height: 100%; padding-top:20px; margin-left:-300px; padding-top: 40px; z-index: 999; } .sidebar-panel ul{ list-style:none; padding:0; margin:0; margin-top:20px; } .sidebar-panel ul li{ background: #000; color: #fff; font-size: 1.4em; margin-bottom: 20px; border-radius: 10px; padding: 10px 0; border: 5px solid #fff; transition:ease 0.4s; } .sidebar-panel ul li:hover { background: #fff700; color: #000; box-shadow: 2px 3px 6px 2px #000; font-weight:bold; transition:ease 0.4s; letter-spacing: 5px; } .side-content{ width:100%; max-width:991px; margin:0 auto; }
$( document ).ready(function() { $('.opennav').click(function(){ $('.sidebar-panel').addClass('activate'); $('.sidebar-panel').removeClass('unactivate'); $('.black-overlay').addClass('dark'); }); $('.closeing').click(function(){ $('.sidebar-panel').addClass('unactivate'); $('.sidebar-panel').removeClass('activate'); $('.black-overlay').removeClass('dark'); }); $('.black-overlay').click(function(){ $('.black-overlay').removeClass('dark'); $('.sidebar-panel').addClass('unactivate'); }); });

Related: See More


Questions / Comments: