Rufusmedia
2/9/2015 - 5:25 AM

slide out menu

slide out menu


* {
  box-sizing: border-box; 
}

.toggle {
  background: #fc0;
  color: #333;
  display: inline-block;
  padding: 10px 15px;
  position: absolute;
  z-index: 900;
  top: 30px;
  left: 30px;
  cursor: pointer;
}

nav {
  background: #eee;
  width: 250px;
  position: fixed;
  z-index: 1000;
  top:0;
  left:-250px;
  opacity: 0;
  bottom:0;
  transition: all .25s;
  border-right: solid 1px #ddd;
}

.open nav {
  opacity: 1;
  left: 0;
}

nav ul {
  background: #555;
  margin: 0;
  padding: 100px 0 0 0;
  list-style: none;
}

nav li:first-child {
  border-top: solid 3px #ddd;
}

nav li {
  border-bottom: solid 3px #ddd;
}

nav a {
  text-decoration: none;
  display:block;
  padding: 15px 30px;
  text-align:center;
  background: #eee;
  color: #555;
  transition: all .25s;
}

nav a:hover {
  background: lighten(#555, 70%);
}

nav .toggle {
  background: lighten(red, 10%);
  color: #fff;
  right: 0;
  top:0;
  left: auto;
}
$(".toggle").on("click", function(){
  $("body").toggleClass("open");
});
<div class="toggle">Menu</div>
<nav>
  <div class="toggle">Close</div>
  <ul class="menu">
    <li><a href="#">Nav Component</a></li>
    <li><a href="#">Nav Component</a></li>
    <li><a href="#">Nav Component</a></li>
    <li><a href="#">Nav Component</a></li>
    <li><a href="#">Nav Component</a></li>
  </ul>
</nav>