-
AuthorPosts
-
February 16, 2023 at 11:59 am #1398203
Hi Kriesi Team,
sorry, but i can’t find a proper solution to an issue here in the forum.Is it possible to get the av-burger-overlay Menu to close by clicking on the active menu item?
I think it’s more user friendy if you are on desktop view and don’t have to go to the x to close
the menu if you want to stay on the current site.Do you have any solution or is it planned to implement that issue to the theme in general?
Thank you very much!
Best regards,
JasperFebruary 16, 2023 at 1:21 pm #1398210Hey Jasper_1,
Thanks for your question, I have tested using the burger menu on the desktop on my demo site, and clicking the current menu item does close the menu overlay.
Perhaps you have a customization or a plugin interfering with this behavior on your site, try disabling these on your site to isolate the issue.
If you can’t please include an admin login in the Private Content area so we can check.Best regards,
MikeFebruary 16, 2023 at 2:00 pm #1398218Hi Mike,
i’ve tested it on many enfold websites and it’s not working. Either desktop nor mobile and in different browsers.
Please see your demos on the kriesi.at website. It’s not working.
Maybe i’ve made it not clear? The problem is, if you are (for example) on the Frontpage and you open the burger menu,
you’re not able to close the menu by clicking on the Frontpage menu item again. But if you just want to stay on the Frontpage,
that would be a common way to just close the overlay menu.Best regards,
JasperFebruary 16, 2023 at 7:03 pm #1398247Hi,
I have tested my demo page linked above on Windows in Chrome, Firefox, & Edge which has the desktop burger menu showing and going to a page like the frontpage or the features page and then clicking the same menu item again closes the menu. I also tested this on a actual Android device.
But I do see the error on our 2017 Demo on mobile since the desktop burger menu is not active, I will ask the rest of the team what they are experiencing on their demos, do you find my demo to be working as I say?Best regards,
MikeFebruary 16, 2023 at 8:51 pm #1398262Hi Mike,
in your demo it works but in all other demos it does not. See for example here: https://kriesi.at/themes/enfold-minimal-photography/Also it doesn’t matter if it’s the mobile menu or desktop, it should work on both.
I think it’s because of the /#top after the href of the current-menu-item.
Is there a way to correct that?Here is a link to an older forum post, but it’s very complicated and not update save:
Best regards,
JasperFebruary 17, 2023 at 1:50 pm #1398343Hi,
Thank you for your patience, I don’t believe that it is related to the /#top after the href of the current-menu-item because my test site has the /#top, but that aside if you want to remove the /#top please see this solution: How to remove #top in menu link
To close the burger menu on the current menu click please try the following script, I tested it on desktop burger menu with the overlay such as this demo:
in which it fades the overlay slowly while closing the menu.
and I also tested it on a flyout burger menu example such as this demo:
in which it slides the menu closed slowly as expected.
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function close_burger_overlay_for_current_menu_item() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($) { $('.current-menu-item a').click(function () { $('.av-hamburger').removeClass('is-active'); $('html').removeClass('av-burger-overlay-active'); $('html').removeClass('av-burger-overlay-active-delayed'); $('.html_av-overlay-side .av-burger-overlay-scroll').css({'transition' : 'all 0.5s cubic-bezier(0.75,0,0.25,1)'}); setTimeout(function () { $('.av-burger-overlay').fadeTo(500, 0); }, 500); }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'close_burger_overlay_for_current_menu_item');
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
If this doesn’t work for you please include an admin login to your site so we can ensure you are not getting jQuery errors and investigate.
Please note that the demo links above are for reference, I can not add the script to our official demo site, I tested by injecting the javascript though the browser and it worked in my tests.
I have not heard back from the rest of the team yet, but I will refer this to the Dev Team for their review.Best regards,
MikeFebruary 21, 2023 at 1:00 pm #1398768Hi,
Thanks for your patience, The Dev Team has adjusted the two files:
enfold/js/avia-snippet-hamburger-menu.js
enfold/js/avia-snippet-hamburger-menu.min.js
These are linked below, please try them on your install and be sure to clear your site, server, and browser cache.
Please don’t test with the script I posted above or the precious /#top modification, if you had applied it.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.