Last active
January 31, 2020 11:16
-
-
Save frontend-coder/b947f0c5c03d0c4a660cb8d142e678c0 to your computer and use it in GitHub Desktop.
Mobile Menu Toggle Button #nav
This file contains 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
<!-- jQuery --> | |
$(".toggle-mnu").click(function() { | |
$(this).toggleClass("on"); | |
$(".main-mnu").slideToggle(); | |
return false; | |
}); |
This file contains 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
/*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 конец оформления кнопки меню*/ |
This file contains 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
<!-- 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