A Pen by Nikesh Suwal on CodePen.
-
-
Save Nikeshsuwal/3a7b15d0d821f4fd1f62 to your computer and use it in GitHub Desktop.
EPadxd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Slide Over Menu</h1> | |
<div class="nav-toggle">Menu <i class="fa fa-bars fa-1x"></i></div> | |
<nav role='navigation' class="main-menu"> | |
<span class="nav-toggle close">close <i class="fa fa-times"></i></span> | |
<ul> | |
<li><a href="#">Home</a></li> | |
<li><a href="#">About</a></li> | |
<li><a href="#">Clients</a></li> | |
<li><a href="#">Contact Us</a></li> | |
</ul> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('.main-menu ul').hide() | |
$('.nav-toggle').on('click',function(){ | |
$('.main-menu ul').toggle(); | |
$('.main-menu').toggleClass('open'); | |
}); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nav | |
width: 300px | |
height: 100% | |
ul | |
padding-left: 0 | |
margin-top: 40px | |
li | |
list-style: none | |
border-bottom: 1px solid #444 | |
a | |
padding: 10px | |
text-decoration: none | |
display: block | |
color: #555 | |
font: | |
size: 18px | |
.main-menu | |
position: fixed | |
left: 0 | |
top: 70px | |
height: 100% | |
width: 300px | |
background: #222 | |
transform: translateX(-100%) | |
transition: transform 1s ease | |
.main-menu.open | |
transform: translateX(0) | |
.nav-toggle | |
color: black | |
padding: 10px | |
cursor: pointer | |
font: | |
weight: bold | |
size: 20px | |
.close | |
color: #fff | |
position: absolute | |
top: 5px | |
right: 5px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment