Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active December 10, 2015 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robneu/4356887 to your computer and use it in GitHub Desktop.
Save robneu/4356887 to your computer and use it in GitHub Desktop.
Add a mobile responsive menu to a Genesis Child Theme - JavaScript
jQuery(document).ready(function($){
// Show/hide the main navigation
$('.menu-toggle').click(function() {
var target = $(this).parent().children('.nav-primary');
$(target).slideToggle('fast', function() {
return false;
// Animation complete.
});
});
// Stop the navigation link moving to the anchor (Still need the anchor for semantic markup)
$('.menu-toggle a').click(function(e) {
e.preventDefault();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment