-
AuthorPosts
-
April 22, 2022 at 9:11 am #1349112
Hello,
We’re currently using a regular hamburger menu on desktop with “Sidebar Flyout Menu (Minimal)” as Menu Overlay Style.
With “Display submenu items on click” we have an issue with the menu, that opened sub-menus doesn’t close when another one is opened, so we’re currently using hover instead of click as not-hover will close the sub-menu.
However there is an issue with the 0.3s (ease?) transition animation. If we accidentally hover over a second/two menu items when targeting a sub-menu item with cursor, the entire menu starts to animate up and down indefinitely.
I can’t seem to get rid of the transition, even when targeting everything with “transition: none !important”. It seems that the menu items gets appended a class called “.av-show-submenu” which transitions px height etc. when the sub-menu goes from display:none to display:block.
Would love to get some help on this one.Link to website in private.
- This topic was modified 2 years, 7 months ago by tekniskakari.
April 22, 2022 at 4:28 pm #1349148Hey tekniskakari,
Could you try updating the theme to the latest version (4.9.2.1) to see if that helps please? https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#theme-update.
Best regards,
RikardApril 22, 2022 at 5:28 pm #1349167This little snippet is only for 1st level submenu !
It will show then only one submenu open at a time – on click another submenu item the other will close. Is it that what you like to achieve?
_____________
Just let the setting to show submenu on click – and insert this to your child-theme functions.php:function only_one_submenu_open(){ ?> <script> (function($) { $(document).ready(function(){ $('body').on( 'click touch', '.av-active-burger-items > a', function () { $(this).parent('li').siblings().removeClass('av-show-submenu'); $(this).parent('li').siblings().find('ul').slideUp( "fast"); }); $('body').on( 'click touch', '.av-active-burger-items .av-width-submenu > a', function () { $(this).closest('.sub-menu').siblings().find('li').removeClass('av-show-submenu'); $(this).closest('.sub-menu').siblings().find('ul').slideUp( "fast"); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'only_one_submenu_open');
April 25, 2022 at 9:36 am #1349363Thanks Guenni for making the jQuery function, it works when it’s set to click. Appreciated :)
April 25, 2022 at 11:25 am #1349372Hi,
Great, I’m glad that @guenni007 could help you out. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.