Skip to content

Instantly share code, notes, and snippets.

@pdmade
Created June 14, 2016 16: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 pdmade/43ccdb8b9d32b9304859628af51d2865 to your computer and use it in GitHub Desktop.
Save pdmade/43ccdb8b9d32b9304859628af51d2865 to your computer and use it in GitHub Desktop.
jQuery for dropdown menus
//MOBILE SUBMENU
jQuery ( '#site-menu li.menu-item-has-children' ).prepend('<div class="menu-item-has-children"></div>');
jQuery( '#site-menu li.menu-item-has-children' ).on('click', function() {
jQuery(this).toggleClass('rotate open-sesame');
});
jQuery('html').on('click', function() {
//Hide the menus if visible
jQuery('span').removeClass('rotate');
jQuery('ul').removeClass('open-sesame');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment