" Sidebar Menu To Top"
Bootstrap 4.1.1 Snippet by nathpreeti15

<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="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark"> <a class="navbar-brand" href="#">FilingSearch</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation" > <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarCollapse"> <ul class="navbar-nav mr-auto sidenav" id="navAccordion"> <li class="nav-item active"> <a class="nav-link" href="#"> <i class="fa fa-dashboard fa-lg"></i> Sign-in/Register</a> </li> <li class="nav-item"> <hr class="solid"> </li> <li class="nav-item"> <a class="nav-link" href="#">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Companies</a> </li> <li class="nav-item"> <a class="nav-link nav-link-collapse" href="#" id="hasSubItems" data-toggle="collapse" data-target="#collapseSubItems2" aria-controls="collapseSubItems2" aria-expanded="false" >Searches</a> <ul class="nav-second-level collapse" id="collapseSubItems2" data-parent="#navAccordion"> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">LiveFeed</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Filing Search</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Market Data</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Mutual Fund Search</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Ownership Search</span> </a> </li> </ul> </li> <li class="nav-item"> <a class="nav-link nav-link-collapse" href="#" id="hasSubItems" data-toggle="collapse" data-target="#collapseSubItems3" aria-controls="collapseSubItems3" aria-expanded="false" >Business News</a> <ul class="nav-second-level collapse" id="collapseSubItems3" data-parent="#navAccordion"> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Investing</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Recovery</span> </a> </li> </ul> </li> <li class="nav-item"> <a class="nav-link nav-link-collapse" href="#" id="hasSubItems" data-toggle="collapse" data-target="#collapseSubItems4" aria-controls="collapseSubItems4" aria-expanded="false" >ESG News</a> <ul class="nav-second-level collapse" id="collapseSubItems4" data-parent="#navAccordion"> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Environment</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Social Responsiblity</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <span class="nav-link-text">Corporate Governance</span> </a> </li> </ul> </li> <li class="nav-item"> <a class="nav-link" href="#">Watchlist</a> </li> <li class="nav-item"> <hr class="solid"> </li> <li class="nav-item"> <a class="nav-link" href="#">About Us</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Terms & Conditions</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Privacy Policy</a> </li> </ul> <ul class="navbar-nav ml-auto mt-2 mt-md-0""> <li class="nav-item"> <a class="nav-link" href="#"> <i class="fa fa-bell"> <span class="badge badge-info">11</span> </i> Test </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> <i class="fa fa-globe"> <span class="badge badge-success">11</span> </i> Test </a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-envelope-o"> <span class="badge badge-primary">11</span> </i> Dropdown </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Something else here</a> </div> </li> </ul> </div> </nav>
.hr.solid { border-top: 5px solid #c7c7c7; } .nav-link:hover { transition: all 0.4s; } .nav-link-collapse:after { float: right; content: '\f067'; font-family: 'FontAwesome'; } .nav-link-show:after { float: right; content: '\f068'; font-family: 'FontAwesome'; } .nav-item ul.nav-second-level { padding-left: 0; } .nav-item ul.nav-second-level > .nav-item { padding-left: 20px; } .navbar-icon-top .navbar-nav .nav-link > .fa { position: relative; width: 36px; font-size: 24px; } .navbar-icon-top .navbar-nav .nav-link > .fa > .badge { font-size: 0.75rem; position: absolute; right: 0; font-family: sans-serif; } .navbar-icon-top .navbar-nav .nav-link > .fa { top: 3px; line-height: 12px; } .navbar-icon-top .navbar-nav .nav-link > .fa > .badge { top: -10px; } @media (min-width: 992px) { .sidenav { position: absolute; top: 0; left: 0; width: 230px; height: calc(100vh - 3.5rem); margin-top: 3.5rem; background: #343a40; box-sizing: border-box; border-top: 1px solid rgba(0, 0, 0, 0.3); } .navbar-expand-lg .sidenav { flex-direction: column; } } @media (min-width: 576px) { .navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link { text-align: center; display: table-cell; height: 70px; vertical-align: middle; padding-top: 0; padding-bottom: 0; } .navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa { display: block; width: 48px; margin: 2px auto 4px auto; top: 0; line-height: 24px; } .navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa > .badge { top: -7px; } } @media (min-width: 768px) { .navbar-icon-top.navbar-expand-md .navbar-nav .nav-link { text-align: center; display: table-cell; height: 70px; vertical-align: middle; padding-top: 0; padding-bottom: 0; } .navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa { display: block; width: 48px; margin: 2px auto 4px auto; top: 0; line-height: 24px; } .navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa > .badge { top: -7px; } } @media (min-width: 992px) { .navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link { text-align: center; display: table-cell; height: 70px; vertical-align: middle; padding-top: 0; padding-bottom: 0; } .navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa { display: block; width: 48px; margin: 2px auto 4px auto; top: 0; line-height: 24px; } .navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa > .badge { top: -7px; } } @media (min-width: 1200px) { .navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link { text-align: center; display: table-cell; height: 70px; vertical-align: middle; padding-top: 0; padding-bottom: 0; } .navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa { display: block; width: 48px; margin: 2px auto 4px auto; top: 0; line-height: 24px; } .navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa > .badge { top: -7px; } }
$(document).ready(function() { $('.nav-link-collapse').on('click', function() { $('.nav-link-collapse').not(this).removeClass('nav-link-show'); $(this).toggleClass('nav-link-show'); }); });

Related: See More


Questions / Comments: