Created
November 14, 2013 14:12
-
-
Save ImBobby/7467432 to your computer and use it in GitHub Desktop.
A Pen by Bobby.
This file contains hidden or 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
<ul class="nav"> | |
<li><a href="#">link</a></li> | |
<li> | |
<a href="#">link</a> | |
<button class="open-subnav">×</button> | |
<ul class="subnav"> | |
<li><a href="#">sublink</a></li> | |
<li><a href="#">sublink</a></li> | |
<li><a href="#">sublink</a></li> | |
</ul> | |
</li> | |
<li><a href="#">link</a></li> | |
<li><a href="#">link</a></li> | |
<li><a href="#">link</a></li> | |
</ul> |
This file contains hidden or 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
$(document).ready(function(){ | |
$('button').click(function() { | |
$(this).next().slideToggle(); | |
}); | |
}); |
This file contains hidden or 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
@import "compass"; | |
$desktop: "screen and (min-width: 60em)"; | |
*{ | |
@include box-sizing(border-box); | |
} | |
ul{ | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
.nav{ | |
margin-top: 2em; | |
> li{ | |
border-bottom: solid 1px white; | |
position: relative; | |
@media #{$desktop}{ | |
display: inline-block; | |
&:hover .subnav{ | |
display: block; | |
} | |
} | |
} | |
a{ | |
background: #369; | |
color: white; | |
padding: 1em 1.6em; | |
} | |
} | |
.subnav{ | |
//width: 100%; | |
display: none; | |
@media #{$desktop}{ | |
position: absolute; | |
} | |
li + li{ | |
border-top: solid 1px white; | |
} | |
a{ | |
background: #333; | |
} | |
} | |
a{ | |
display: block; | |
text-decoration: none; | |
} | |
button{ | |
background: none; | |
border: none; | |
color: white; | |
position: absolute; | |
right: 0; | |
top: 0; | |
@media #{$desktop}{ | |
display: none; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment