-
-
Save billerickson/aeafb124c043a67164f9 to your computer and use it in GitHub Desktop.
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
| <?php | |
| /** | |
| * Mobile Menu | |
| * | |
| */ | |
| function be_mobile_menu() { | |
| echo '<div class="mobile-menu mobile-show"><i class="fa fa-bars"></i><i class="fa fa-close hidden"></i></div>'; | |
| } | |
| add_action( 'genesis_header', 'be_mobile_menu', 12 ); |
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
| // Mobile Menu | |
| // -- Mobile Menu Open | |
| $('.mobile-menu .fa-bars, .mobile-menu .fa-close').click(function(e){ | |
| $('.site-header').toggleClass('menu-active'); | |
| $('.mobile-menu .fa-bars, .mobile-menu .fa-close').toggleClass('hidden'); | |
| $('.nav-header').slideToggle(); | |
| e.preventDefault(); | |
| }) | |
| // -- Mobile Submenu Open | |
| $('.site-header .nav-header .menu-item-has-children > a').click(function(e){ | |
| $(this).siblings().addClass('active'); | |
| $('.site-header .nav-header').animate({ | |
| left: '-100%', | |
| }, 500, function(){}); | |
| e.preventDefault(); | |
| }); | |
| // -- Mobile Submenu Close | |
| $('.site-header .nav-header .sub-menu').prepend( '<li class="menu-item back"><a href="#">Back</a></li>' ); | |
| $('.site-header .nav-header .sub-menu .back > a').click(function(e){ | |
| $('.site-header .nav-header').animate({ | |
| left: '0', | |
| }, 500, function(){ | |
| $('.site-header .nav-header .sub-menu.active').removeClass('active'); | |
| }); | |
| e.preventDefault(); | |
| }); |
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
| @media only screen and (max-width: 767px) { | |
| /* Mobile Menu */ | |
| .site-header .wrap { | |
| position: relative; | |
| padding: 0; | |
| } | |
| .site-header .mobile-menu { | |
| position: absolute; | |
| top: 7px; | |
| right: 20px; | |
| font-size: 30px; | |
| line-height: 1; | |
| } | |
| .site-header .mobile-menu i { | |
| cursor: pointer; | |
| } | |
| .site-header .mobile-menu i:hover { | |
| color: #1894a7; | |
| } | |
| .site-header .mobile-menu .hidden { | |
| display: none; | |
| } | |
| .site-header .nav-header { | |
| background: #fff; | |
| position: absolute; | |
| z-index: 10; | |
| width: 100%; | |
| display: none; | |
| } | |
| .site-header .nav-header .genesis-nav-menu li { | |
| display: block; | |
| font-size: 24px; | |
| } | |
| .genesis-nav-menu .signup, .genesis-nav-menu .login { | |
| margin: 10px auto; | |
| max-width: 300px; | |
| } | |
| .genesis-nav-menu .menu-item-has-children > a:after { | |
| content: ''; | |
| display: inline-block; | |
| margin-left: 10px; | |
| width: 0; | |
| height: 0; | |
| border-style: solid; | |
| border-width: 6px 0 6px 6px; | |
| border-color: transparent transparent transparent #1894a7; | |
| } | |
| .genesis-nav-menu .menu-item, | |
| .genesis-nav-menu .menu-item:hover { | |
| position: static; | |
| } | |
| .genesis-nav-menu .sub-menu { | |
| background: #fff; | |
| top: 0; | |
| position: absolute; | |
| left: auto; | |
| opacity: 1; | |
| width: 100%; | |
| z-index: 9; | |
| display: none; | |
| } | |
| .genesis-nav-menu .sub-menu a { | |
| background: #fff; | |
| color: #2d2d2d; | |
| width: 100%; | |
| } | |
| .genesis-nav-menu .sub-menu li:hover > a { | |
| background: #fff; | |
| color: #1894a7; | |
| } | |
| .genesis-nav-menu .sub-menu.active { | |
| display: block; | |
| right: -100%; | |
| } | |
| .genesis-nav-menu .sub-menu .back > a:before { | |
| content: ''; | |
| display: inline-block; | |
| margin-right: 10px; | |
| width: 0; | |
| height: 0; | |
| border-style: solid; | |
| border-width: 6px 6px 6px 0; | |
| border-color: transparent #1894a7 transparent transparent; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment