damianwajer/ml-stack-nav

menu NOT closing

Closed this issue · 7 comments

Hey there, thanks for that handy plugin. I love it.

One problem though. I DO want to close the menu entirely, whenever somene clicks on an item (that is not the next button of course). Also the link is on the same page (a href="#pageitem").

Any suggestions? Thanks for the help!

@ynotpeanutbutter Hello, thanks for the kind words ;)

You can achieve it using click event and close method, e.g.

$(".ml-stack-nav__link").on("click", function () {
    $(".js-ml-stack-nav").mlStackNav("close");
});

Dmianwajer! This is great. I was actually trying that but took the wrong string.
Thank you so much!

You're welcome :)

FYI: I've added all available methods and events to the documentation, so now you can see more information there:

Great!

I'm experiencing a new problem though. Everything works fine and as expected. But: I cannot click on any link of the body part. It seems that even the colapsed (and therefore not visible) menu has overlaped the content. The problem must be inside the theme.css
I tried giving .ml-stack-nav a pointer-events:none; but then I can't click on the menu links anymore. Any thoughts? Thanks in advance

Can you provide more details like browser and OS versions?

hey damianwayjer, i figured it out! I made a mistake and put the nav container inside of the header div (to make it work with my CMS). Now I excluded it and everything works perfectly. Nicely done, and thanks again for your quick response!

mlStackNav should be placed at the top-level position to avoid the stacking context issues, I will add this info to the documentation.

I'm glad it works for you. If you like it, please consider adding a star on GitHub in top-right corner of the page :)