"Simple Side Nav"
Semantic UI 2.2.10 Snippet by nandiraju

<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.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="main-wrapper"> <div class="ui menu navbar main-menu borderless"> <a href="" id="side-nav" class=" item borderless"><i class="content icon"></i></a> <a href="" id="full-screen" class=" item borderless fitted"><i class="maximize icon"></i></a> <a href="" class=" item">Product</a> <div class="right menu borderless horizontally fitted"> <a class="item"> <div class="ui icon input"> <input type="text" placeholder="Search..." style="border-radius:20px;"> <i class=" search link icon"></i> </div> <!-- <i class="search icon"></i> --> </a> <a href="#" class="item"> <i class="ui large bell teal icon"></i> <label class="ui orange circular label mini" style="margin-left:-13px;margin-top:-20px;"> 10 </label> </a> <a class="ui dropdown item"><img class="ui avatar image" src="https://semantic-ui.com/images/wireframe/square-image.png"> John Smith <i class="dropdown icon"></i> <div class="menu"> <div class="item"> <i class="mail icon"></i> Messages </div> <div class="item"> <i class="mail icon"></i> Messages </div> <div class="divider"></div> <div class="item"> <i class="attention icon"></i> Important </div> <div class="item"> <i class="comment icon"></i> Announcement </div> <div class="divider"></div> <div class="item"> <i class="sign out icon"></i> Logout </div> </div> </a> </div> </div> <div class="ui container center aligned" style="margin-top: 100px;"> <h1 id="">CENTERED HEADING</h1> <p style="padding:300px;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> </div> <div class="side-wrapper"> <div class="ui visible vertical menu inverted blue inside-menu" style="width:200px;"> <div class="item "> <!-- <img src="https://cdn3.iconfinder.com/data/icons/pix-glyph-set/50/520775-paypal-256.png" /><img src="https://cdn3.iconfinder.com/data/icons/pix-glyph-set/50/520775-paypal-128.png" style="display: none" /> --> </div> <div class="ui accordion inverted blue"> <a class="title item">Dashboard <i class="dropdown icon"></i></a> <div class="content"> <a class="item" href="dashboard.html">Sub - Dashboard <i class="user small icon"></i></a> </div> <!-- <a class="item"> <b>Components</b> </a> --> <div class="title item"> <i class="dropdown icon"></i> UI </div> <div class="content"> <a class="item" href="accordion.html">Sub-UI-1</a> <a class="item" href="breadcrumb.html">Sub-UI-2</a> </div> </div> <!-- The hidden nav menu --> </div> </div>
body, html { margin: 0px; padding: 0px; overflow: hidden; } .main-wrapper { background: #f1f1f1; position: absolute; top: 40px; left: 200px; bottom: 0px; right: 0px; /*border: solid 5px blue;*/ transition: all 0.3s ease; overflow: auto; } .side-wrapper { position: absolute; top: 0px; left: 0px; width: 200px; bottom: 0px; /*border: solid 5px red;*/ position: absolute; transition: all 0.3s ease; } .hide-side-bar { left: -200px; } .expand-main-wrapper { left: 0px; } .side-wrapper .inside-menu { padding: 10px; border-radius: 0px; height: 100%; } .main-menu { position: fixed; top: 0px; left: 200px; right: 0px; transition: all 0.3s ease; } .expand-main-menu { left: 0px; }
$(document).ready(function() { $("#side-nav").on("click", function(e) { e.preventDefault(); $(".side-wrapper").toggleClass("hide-side-bar"); $(".main-wrapper").toggleClass("expand-main-wrapper"); $(".main-menu").toggleClass("expand-main-menu"); }); $('#full-screen').click(function() { $(document).toggleFullScreen(); return false; }); $(".ui.dropdown").dropdown({ allowCategorySelection: true, transition: "fade up", context: 'sidebar', on: "hover" }); $('.ui.accordion').accordion({ selector: {} }); });

Related: See More


Questions / Comments: