Skip to content

Instantly share code, notes, and snippets.

@trangsihung
Created March 3, 2017 02:23
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 trangsihung/2e8a03b355143ef6bb8c062ec5919419 to your computer and use it in GitHub Desktop.
Save trangsihung/2e8a03b355143ef6bb8c062ec5919419 to your computer and use it in GitHub Desktop.
Nav Side
$('.mobile-toggle a').on('click', function(e) {
e.preventDefault();
$('.mobile-nav-overlay').fadeIn(400, function() {
$('.mobile-nav-outer').addClass('opened');
});
});
$('.mobile-nav-overlay .close-button').on('click', function(e) {
e.preventDefault();
$('.mobile-nav-outer').removeClass('opened');
$('.mobile-nav-overlay').fadeOut(400);
});
.mobile-nav-overlay {
// display: none;
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background-color: rgba(0,0,0,.5);
.mobile-nav-outer {
box-shadow: 1px 1px 10px #efefef;
position: absolute;
left: 0; top: 0;
padding: 50px 20px 20px;
background-color: #212121;
max-width: 275px;
width: 85%;
height: 100vh;
@include translate(-400px);
@include transition( transform .3s );
&.opened {
@include translate(0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment