Created
July 15, 2016 15:19
-
-
Save chrismcintosh/b659b0802d9789f8d3d67a7274fd5359 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
setupMenus(); | |
$( window ).resize( function() { | |
setupMenus(); | |
}); | |
function setupMenus () { | |
if ( window.innerWidth <= 768 ) { | |
$( 'ul.menu-secondary > li' ).addClass('moved-item'); //tag moved items so we can move them back | |
$( 'ul.menu-secondary > li' ).appendTo( 'ul.menu-primary' ); | |
$( '.nav-secondary' ).hide(); | |
} | |
if ( window.innerWidth > 768 ) { | |
$( '.nav-primary .genesis-nav-menu, nav .sub-menu' ).removeAttr( 'style' ); | |
$( '.responsive-menu > .menu-item' ).removeClass( 'menu-open' ); | |
$( '.nav-secondary' ).show(); | |
$( 'ul.menu-primary > li.moved-item' ).appendTo( 'ul.menu-secondary' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment