mikeoberdick

Toggle Divi Theme Submenu on Mobile

Feb 21st, 2016
5,315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.44 KB | None | 0 0
  1. <script type="text/javascript">
  2. (function($) {
  3. $(window).load(function() {
  4.  
  5. $('#mobile_menu > .menu-item-has-children > a').attr('href', '#');
  6. $('#mobile_menu > .menu-item-has-children > a').each(function() {
  7. $(this).next('.sub-menu').addClass('hide');
  8. });
  9.  
  10. $('#mobile_menu > .menu-item-has-children > a').click(function(event) {
  11. event.preventDefault();
  12. $(this).next('.sub-menu').toggleClass('visible');
  13. });
  14.  
  15. });
  16. })(jQuery);
  17. </script>
Add Comment
Please, Sign In to add comment