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

v2 Bug on mobile devices #14

Open
G-dogger opened this issue Dec 28, 2016 · 7 comments
Open

v2 Bug on mobile devices #14

G-dogger opened this issue Dec 28, 2016 · 7 comments

Comments

@G-dogger
Copy link

The v2 megamenu works fine on computers, but not on mobile devices; including Android and iPhone.

When you open the menu and try to scroll up or down through sub-menu choises, the menu closes. Just the slightest touch and it closes. Please help! Thanks! Example can be found here: http://www.hannabery.com/01homev2.html

@G-dogger
Copy link
Author

I found the part of the code causing the problem, just don't know how to fix it. In the JS file at end:

$(window).resize(function () {
if (getWindowWidth() < responsiveBreakpoint) {
$('.menu > ul').removeClass('is-shown-on-mobile');
$('.menu li').children('ul').hide();
$('.dropdown-button-text').removeClass('is-active');
$('.hamburger').removeClass('is-active');
} else {
$('.menu > ul > li > ul > li').children('ul').show();
}
});

If you remove this section, the menu will work fine on a phone, but then you can't use it properly on a computer when resizing browser with expanded menu - it breaks. Hope you can provide a fix!!!

@born2net
Copy link

born2net commented Jan 1, 2017

yes I see the same issue, I really would like to use this menu but ya seems like a show stopper, as soon as you lift your finger from the slide, menu closes up.
tx for a great menu by the way!!!!

@G-dogger
Copy link
Author

G-dogger commented Jan 2, 2017

Mario, I installed v2 files, but it does not work properly on smart phones. The problem is caused by the window.resize function. Hoping you can provide a fix???????????

@G-dogger
Copy link
Author

G-dogger commented Jan 4, 2017

Maybe you need to check for document_height; as well as width for mobiles???

@leekangsan
Copy link

Yes, I have the same problem. Hoping you can provide a fix???????????

@pitcock
Copy link

pitcock commented Nov 23, 2017

changing the line

$(window).resize(function () {

to

$(window).on("orientationchange", function() {

works for me on iPhone but has to be tested. "orientationchange" is recommended by Apple.

@G-dogger
Copy link
Author

G-dogger commented Nov 23, 2017 via email

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

4 participants