Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu Links with Children Not Clickable #9

Open
izzyartanddesign opened this issue Jan 22, 2019 · 7 comments
Open

Menu Links with Children Not Clickable #9

izzyartanddesign opened this issue Jan 22, 2019 · 7 comments

Comments

@izzyartanddesign
Copy link

Great plugin. I have one issue that's preventing me from utilizing it though. If a menu item is a parent, you can never actually navigate to that menu item link, since clicking on parent items always slides to their child menu, or slides back to the parent menu it was on before. Is there any way to have the parent item links clickable as they would be normally, and have the submenu link option, such as a span tag, appended -after- the actual menu item link tag so you can be able to click on just the span tag of the parent items to navigate forward/back, and when you click on the actual menu item links, they navigate to their pages?

@grubersjoe
Copy link
Owner

grubersjoe commented Jan 28, 2019

Thank you :). I agree, that the current approach has some drawbacks, since it should also be possible to navigate to index pages. I refactored the code in #8 anyway and the new code will use span tags for the link arrows. So I guess it should be pretty straight-forward to implement it like you propose.

I'm going to look into this in march (right now I'm quite busy unfortunately).

@stevenbrown-85
Copy link

Just wondering if this was factored in? and if so, how to implement it?

@nickfmc
Copy link

nickfmc commented Feb 16, 2020

It would be awesome If you could just add that parent link to the first link inside the child menu and then have an option to change the "showBackLink" to be text of your choosing such as "Back" that way you click say and "About Us" menu item your panel slides in and it goes "BACK, about us, about us child pages"

@nickfmc
Copy link

nickfmc commented Feb 16, 2020

here is a jQuery solution that might work for some to add a back button and prepend the parent link to the top of the child list.


var enhanced_menu_selector = '#menu-id';

function enhanced_menu_search_children(menu) {
  $(menu).find('> li').each(function () {
    if ($(this).find('> ul').length !== 0) {
      $(this).find('> ul').hide();
      $(this).find('> ul').prepend('<button type="button" class="btn slide-menu__control" data-action="back">Back</button><li class="menu-nested-overview">' + $(this).find('> a')[0].outerHTML + '</li>');
      enhanced_menu_search_children($(this));
    }
  });
}

enhanced_menu_search_children($(enhanced_menu_selector + ' ul'));

@camilla-westin
Copy link

Is there a solution to this?

@nickfmc
Copy link

nickfmc commented Sep 27, 2020

Not sure why the down votes on my answer so here is a fiddle showing my jquery solution. I think this approach is better for usability moving that parent link into the sub menu, because on mobile it's bad UX to have a user click on a small arrow to transverse the menu but clicking on the menu item itself take them to a page! https://jsfiddle.net/nickfmc/gx5tckoy/20/ . This may not be the solution for everyone but it does solve the problem and clients seam to like the behavior.

@nickfmc
Copy link

nickfmc commented Nov 12, 2020

Here is an updated version appending "Overview" to the first item, as per a few clients recommendations https://jsfiddle.net/ufx8gzLp/ @camilla-westin @harrync can you provide info on the downvote so I can adjust the solution if this is not suitable, It's not a fix it's a workaround "hack" but it will do the trick for a lot of people with this issue while we wait for a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants