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

Best way to hide submenu after item was clicked? #6

Open
Octopus75 opened this issue Jul 4, 2016 · 8 comments
Open

Best way to hide submenu after item was clicked? #6

Octopus75 opened this issue Jul 4, 2016 · 8 comments

Comments

@Octopus75
Copy link

Hi, thanks you for your great work.
Actually when we click on a link of a submenu (wide screen version), if we don’t change the actual displayed page, the submenu remains displayed.
What is the best way to hide parent submenu after item was clicked?
I have tried such things:
$(this).closest("ul").fadeToggle(0);
$(this).closest("ul").hide();
$(this).closest("ul").css({"display": "none"});

But this generates inconsistency thereafter.

Many thanks for your help.

@marioloncarek
Copy link
Owner

Hello , im really sorry but i dont understand what are you trying to ask me? Please explain better

@marioloncarek
Copy link
Owner

you are using megamenu on such website which is displaying pages with ajax or ajax-like technology?

@Octopus75
Copy link
Author

Thank you for your reply.
Yes, I’m using megamenu to filter an image gallery with isotope (http://isotope.metafizzy.co/).
The filter links to sort images are displayed in a submenu. When I click on a submenu filter link the image gallery is well filtered but the submenu remains displayed over the image gallery and rollout the submenu list is the only way to make it disappear.
I just like to know if there is a way to automatically hide a submenu list after a click on one of its links.

Many thanks.

@marioloncarek
Copy link
Owner

Im sorry for late response, i will try to fix this bug but i dont really have time to play with it at this moment

@Octopus75
Copy link
Author

Hello Mario,
I adapted your script to hide submenus after a button click.
I have certainly not done this adpatation by following best practice (so I will refrain from sharing my adpated code) but it is enough for me. Therefore no emergency.
Thanks.

@TR0N82
Copy link

TR0N82 commented Aug 10, 2016

Hello Octopus75,
I have the same problem burt I'm noch very good in Javascript.
So I want to ask you to so kind and share your code with me, beause I'm a little bit under time pressure.

Thanks!

@Octopus75
Copy link
Author

Octopus75 commented Aug 10, 2016

Hello TRON82,
Please find attached my adapted version of the megamenu.js script.
You'll have to rename it from "megamenu.txt" to "megamenu.js" (just change the file extension) because I can't join .js files.

It’s enough for my needs but I don’t know if everything will be OK for your requirements.
I hope this will help.
Sorry about that, but I would not have time for prospective adjustments ;-)

megamenu.txt

@marioloncarek
Copy link
Owner

@Octopus75 thank you very much for your contribution to this repo!

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

3 participants