jquery - Horizontal Menu with toggle on the right side -
i browsing thenextweb , saw social icons horizontal menu on right side have toggle button
does knows how it's done?
i have made text version (without graphics) reference can start there.
$('#menu').click(function(){ $('.nav-wrapper').toggleclass('active'); });
.nav-wrapper { list-style: none; float: right; } .nav-wrapper > li { float: left; overflow: hidden; } .nav { list-style: none; margin-right: -115px; transition: 0.3s; } .nav-wrapper.active .nav { margin-right: 0; transition: 0.3s; } .nav > li { float: left; width: 18px; margin: 0 5px; border: 1px solid red; } #menu::after { display: block; content: "open"; width: 60px; height: 20px; cursor: pointer; } .nav-wrapper.active > #menu::after { content: "clos" }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <ul class="nav-wrapper"> <li> <ul id="nav-bar" class="nav"> <li>l1</li> <li>l2</li> <li>l3</li> <li>l4</li> <li>l5</li> <li>l6</li> </ul> </li> <li id="menu"><li> </ul>
Comments
Post a Comment