Skip to content

Instantly share code, notes, and snippets.

@gearmobile
Created May 28, 2015 19:39
Show Gist options
  • Save gearmobile/ac83c66ea9139ff77979 to your computer and use it in GitHub Desktop.
Save gearmobile/ac83c66ea9139ff77979 to your computer and use it in GitHub Desktop.
Toggle Button Menu
Jade:
header.header
.button
.button__item
.button__item
.button__item
.button__item
ul.menu
li.menu__item
a.menu__link(href="#") menu link
li.menu__item
a.menu__link(href="#") menu link
li.menu__item
a.menu__link(href="#") menu link
li.menu__item
a.menu__link(href="#") menu link
Stylus:
.header
padding 50px 100px
.button
size 40px
cursor pointer
&:hover .button__item
opacity 1
&__item
width 100%
height 5px
background-color #fff
opacity .8
margin-bottom 5px
transition all .2s
&:last-child
margin-bottom 0
.menu
list-style-type none
margin 0
padding 0
display none
&__item
display block
&__link
text-decoration none
jQuery:
$(function() {
$('.button').click(function(){
$('.menu').slideToggle();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment