-
AuthorPosts
-
August 1, 2019 at 6:19 pm #1123963
Hello everyone,
how do i get this resolved that only a submenu is open and not all. I’m going too deep.MFG Basti
August 2, 2019 at 7:55 am #1124087Hey Qeibu,
I’m not sure I understand your question, could you post a link to where we can see it and try to explain a bit further please?
Best regards,
RikardAugust 2, 2019 at 8:07 am #1124093Hello Rikard, i create the new Site first offline. My Question to the Burger Menu is. You klick the first menu link and the Sub open. Then you klick on the second link and this sub is open. I need when i klick on second or after then links all other menu links with his submenu‘s are close. I would like to have only one link incl. Submenu open
August 2, 2019 at 6:27 pm #1124220i do not have this to examine if it will work but can you try this in child-theme functions.php:
hm – not working – looking for touchfriendly code
August 2, 2019 at 6:32 pm #1124221just one moment – on touch devices this must be adjusted …
… hm could not find the clue. on avia.js there is that function toggle_submenu( menu, e )
but i do not see how to close the siblings on touch.
Maybe a mod knows better way to do it. – SorryAugust 2, 2019 at 10:32 pm #1124280Hello Guenni007,
thx for Support i have build a fix :-)jQuery(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”, function() {
});
});
});August 3, 2019 at 4:09 am #1124293Hi Qeibu,
Great, I’m glad that you managed to come up with a solution and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardAugust 3, 2019 at 7:03 am #1124322hm – does not work on my end here !
(maybe it is because of my webers-testseite and its child-theme functions.php with over 2000 lines of additional test snippets. But i guess there is something missing.
Can you please post the whole thing you have done. The code f.e. in your child-theme functions.php.Or are you looking only for a solution of first-level menu ( with submenu ) closing? – Then your code is enough for it.
i’m trying to close a second-level by clicking its siblings. This is often the case if you are having a mega menu with column headings and sub-menu under it.so there must be additional code .
the “siblings-structure” is on sub-menu a bit different – maybe this will work:function only_one_submenu_open(){ ?> <script> (function($) { $(document).ready(function(){ $('body').on( 'click touch', '.av-width-submenu > a', function () { $(this).parent('li').siblings().removeClass('av-show-submenu'); $(this).parent('li').siblings().find('ul').slideUp( "fast"); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'only_one_submenu_open');
- This reply was modified 5 years, 3 months ago by Guenni007.
August 3, 2019 at 8:34 am #1124333sometimes ( it depends on the multi-level menu structure it became necessary to have an addon on that:
$('body').on( 'click touch', '.av-width-submenu > a', function () { $(this).parent('li').siblings().removeClass('av-show-submenu'); $(this).parent('li').siblings().find('ul').slideUp( "fast"); });
the li’s on some circumstances are not direct siblings
August 3, 2019 at 9:27 am #1124336Hello Guenni007,
i don‘t use the functions.php. I use a snippet plugin is better for Overview. I see you have a ohter situation.You have li.tutorials > ul.submenu > li > ul.submenu > li
I have li.fahrzeuge > ul.submenu > li
You must be adress the deeper submenu li seperate.
LG Basti
August 3, 2019 at 12:57 pm #1124346May 23, 2020 at 8:46 am #1215377YES! @Guenni007 THANK YOU A MILLION!
This was the perfect solution, and the only one on the internet.
Many thanks!
May 24, 2020 at 1:05 pm #1215717Hi MrPoBoi,
Great, I’m glad that you found @guenni007’s solution. I’ll go ahead and close this thread since a solution has been provided.
Best regards,
Rikard -
AuthorPosts
- The topic ‘[avia_hamburger_menu] Only one open toggle allowed (accordion mode)’ is closed to new replies.