"Nav Sidebar With Toggle Button"
Bootstrap 3.1.0 Snippet by peterxp

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <head> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-4 col-md-3 sidebar"> <div class="mini-submenu pull-right"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </div> <div class="list-group"> <span href="#" class="list-group-item active">   <!--Close Button--> <span class="pull-left" id="slide-submenu"> <i class="glyphicon glyphicon-remove" aria-hidden="true"></i> </span> <!--Logout Button--> <span class="pull-right" id="logout"> <i class="glyphicon glyphicon-off" aria-hidden="true"></i> </span> </span> <a href="#" class="list-group-item"> Brouchure#1 </a> <a href="#" class="list-group-item"> Brouchure#2 </a> <a href="#" class="list-group-item"> Brouchure#3 </a> <a href="#" class="list-group-item"> Brouchure#4 </a> <a href="#" class="list-group-item"> Brouchure#4 </a> <a href="#" class="list-group-item"> Brouchure#6 </a> </div> </div> </div> </div> </body>
.mini-submenu{ display:none; background-color: rgba(0, 0, 0, 0); border: 1px solid rgba(0, 0, 0, 0.9); border-radius: 4px; padding: 9px; /*position: relative;*/ width: 42px; } .mini-submenu:hover{ cursor: pointer; } .mini-submenu .icon-bar { border-radius: 1px; display: block; height: 2px; width: 22px; margin-top: 3px; } .mini-submenu .icon-bar { background-color: #000; } #slide-submenu{ background: rgba(0, 0, 0, 0.45); display: inline-block; padding: 0 8px; border-radius: 4px; cursor: pointer; } .myBackgroud{ backgroud: #0000ff; }
$('body').addClass('myBackgroud'); $(function(){ //initial //original $('#slide-submenu').on('click',function() { $(this).closest('.list-group').fadeOut('slide',function(){ alert('x'); // $('.mini-submenu').fadeIn(); }); }); $('.mini-submenu').on('click',function(){ $(this).next('.list-group').toggle('slide'); $('.mini-submenu').hide(); }) })

Related: See More


Questions / Comments: