Skip to content

Instantly share code, notes, and snippets.

@bearded-avenger
Created October 22, 2014 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bearded-avenger/b66a12a4586c2ac9b001 to your computer and use it in GitHub Desktop.
Save bearded-avenger/b66a12a4586c2ac9b001 to your computer and use it in GitHub Desktop.
Simple off-canvas menu
jQuery(document).ready(function($){
$('a').click(function(e){
e.preventDefault()
$('body').toggleClass('menu-open');
});
});
@width: 200px;
#container {
.transition(transform .25s ease);
}
.menu-open {
#menu {
left:0;
}
#container {
.translate(@width,0);
}
}
#menu {
left:-@width;
width:@width;
top:0;
position:absolute;
.transition(left .25s ease);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment