Last active
December 10, 2015 01:18
-
-
Save robneu/4356887 to your computer and use it in GitHub Desktop.
Add a mobile responsive menu to a Genesis Child Theme - JavaScript
This file contains 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
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