DuelDual
by nathanziarek
HTML
<section class="duel2">
<div id="site-menu-toggle">
<div class="menu-button"></div>
</div>
<nav id="site-menu"></nav>
<div class="primary-content">
<nav class="content-menu">Shop by Supplier</nav>
<div class="content">
<div class="column1">one</div>
<div class="column2">Two</div>
</div>
</div>
</section>
CSS
html, body { background: #333; margin: 0; padding: 0; height: 100% }
.duel2 {
position: relative;
font-family: "Helvetica Neue";
}
#site-menu-toggle {
position: absolute;
top: 0;
left: 0;
z-index: 1000;
width: 40px;
height: 40px;
background: #666;
}
.content {
position: absolute;
bottom: 0;
top: 40px;
left: 0;
right: 0
}
.column1 {
position: absolute;
top: 0;
left: 0;
bottom: 0;
}
.column2 {
position: absolute;
top: 0;
left: 30%;
bottom: 0;
}
.content-menu {
background: #666;
line-height: 40px;
color: white;
margin-left: 40px;
border-left: 1px solid #777;
padding-left: 10px;
font-size: 13px;
}
.column1 { width: 30%; background: red; height: 100% }
.column2 { width: 70%; background: blue; }
/* Menu Button */
.menu-button:before {
width: 20px;
height: 4px;
border-radius: 2px;
background: white;
display: block;
content: "";
position: absolute;
top: -6px;
-webkit-transition: top 300ms linear, -webkit-transform 300ms linear 300ms;
}
.menu-button {
width: 20px;
height: 4px;
border-radius: 2px;
background: white;
position: absolute;
-webkit-transition: background 300ms linear, -webkit-transform 300ms linear;
margin: 8px 0;
z-index: 150;
top: 10px;
left: 10px;
}
.menu-button:after {
width: 20px;
height: 4px;
border-radius: 2px;
background: white;
content: "";
display: block;
position: absolute;
bottom: -6px;
-webkit-transition: bottom 300ms linear, -webkit-transform 300ms linear 300ms;
}
.menu-button.x {
background: transparent;
}
.menu-button.x:after {
-webkit-transform: rotate(-45deg);
bottom: 0;
}
.menu-button.x:before {
-webkit-transform: rotate(45deg);
top: 0
}
JavaScript
$("#site-menu-toggle").click( function(){
$(".menu-button").toggleClass("x");
});