Skip to content

Instantly share code, notes, and snippets.

@jbd91
Created February 2, 2018 04:25
Show Gist options
  • Select an option

  • Save jbd91/fd81f22eb37628750daa6713a6575646 to your computer and use it in GitHub Desktop.

Select an option

Save jbd91/fd81f22eb37628750daa6713a6575646 to your computer and use it in GitHub Desktop.
Off Canvas Duplicate Nav Item Foundation Fix
// Duplicates parent nav item link on off canvas menu and places it in the submenu so link can be clicked (fix for issue with foundation off canvas toggle)
$('.off-canvas li.menu-item-has-children').each(function(){
link=($(this)[0].children[0].outerHTML);
ul=$(this).find($('ul'));
ul.children().children().first().parent().before('<li class="parentlink">'+link+'</li>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment