Created
March 25, 2016 19:12
-
-
Save anonymous/cc1a00c651d7597d61c6 to your computer and use it in GitHub Desktop.
Mobile Menu Toggle Button
This file contains hidden or 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
| <a href="#" class="toggle-mnu hidden-lg"><span></span></a> | |
This file contains hidden or 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
| $(".toggle-mnu").click(function() { | |
| $(this).toggleClass("on"); | |
| $(".main-mnu").slideToggle(); | |
| return false; | |
| }); |
This file contains hidden or 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
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains hidden or 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
| body | |
| background-color: #333 | |
| .toggle-mnu | |
| display: block | |
| width: 28px | |
| height: 28px | |
| margin-top: 14px | |
| span:after, span:before | |
| content: "" | |
| position: absolute | |
| left: 0 | |
| top: 9px | |
| span:after | |
| top: 18px | |
| span | |
| position: relative | |
| display: block | |
| span, span:after, span:before | |
| width: 100% | |
| height: 2px | |
| background-color: #fff | |
| transition: all 0.3s | |
| backface-visibility: hidden | |
| border-radius: 2px | |
| &.on span | |
| background-color: transparent | |
| &.on span:before | |
| transform: rotate(45deg) translate(-1px, 0px) | |
| &.on span:after | |
| transform: rotate(-45deg) translate(6px, -7px) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment