Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Merge secondary menu into primary for mobile
jQuery(document).ready(function($){
function mobile_combine_nav() {
$('.nav-header li.secondary-item').remove();
if ( $('.nav-secondary').css( 'display' ) == 'none' ) {
$('.nav-secondary li').addClass('secondary-item').clone().appendTo('.nav-header ul');
}
}
mobile_combine_nav();
$(window).resize(mobile_combine_nav);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment