Skip to content

Instantly share code, notes, and snippets.

@frontend-coder
Last active January 31, 2020 11:16
Show Gist options
  • Save frontend-coder/b947f0c5c03d0c4a660cb8d142e678c0 to your computer and use it in GitHub Desktop.
Save frontend-coder/b947f0c5c03d0c4a660cb8d142e678c0 to your computer and use it in GitHub Desktop.
Mobile Menu Toggle Button #nav
<!-- jQuery -->
$(".toggle-mnu").click(function() {
$(this).toggleClass("on");
$(".main-mnu").slideToggle();
return false;
});
/*css начало оформления кнопки меню*/
.toggle-mnu
{float:right;
color:#000;
position:absolute;
right:10px;top:0;
text-align:center;
line-height:48px;
}
.toggle-mnu{display:block;
width:28px;
height:28px;
margin-top:20px; margin-right: 15px;
}
.toggle-mnu span:after, .toggle-mnu span:before
{content:"";position:absolute;
left:0;top:9px;
}
.toggle-mnu span:after
{top:18px;}
.toggle-mnu span{position:relative;display:block;}
.toggle-mnu span,.toggle-mnu span:after,.toggle-mnu span:before
{width:100%;
height:2px;
background-color:#fff;
-webkit-transition:all .3s;transition:all .3s;
-webkit-backface-visibility:hidden;
backface-visibility:hidden;
-webkit-border-radius:2px;
border-radius:2px;
}
.toggle-mnu.on span
{background-color:transparent;
}
.toggle-mnu.on span:before
{
-webkit-transform:rotate(45deg) translate(-1px,0);
-ms-transform:rotate(45deg) translate(-1px,0);
transform:rotate(45deg) translate(-1px,0);
}
.toggle-mnu.on span:after{
-webkit-transform:rotate(-45deg) translate(6px,-7px);
-ms-transform:rotate(-45deg) translate(6px,-7px);
transform:rotate(-45deg) translate(6px,-7px);
}
.toggle-mnu.on+#menu
{opacity:1;visibility:visible;
}
/*css конец оформления кнопки меню*/
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment