Tagged: x
-
AuthorPosts
-
March 16, 2017 at 7:27 am #1409479
Gnomo BàgnoloParticipantHi
On page https://www.ilsentierodeglignomi.it/la-magica-favola-di-gnomo-bagnolo/
I have an issue with Mobile MenuOn my Site you have already suggested me these customizations:
CSS
/* Fixed Top on MOBILE */ /* ============================================================================= */ @media (max-width: 979px){ .x-navbar-fixed-top, .x-navbar-fixed-left, .x-navbar-fixed-right { position: fixed; } }JavaScript
// Auto-close MOBILE Menu after click // ============================================================================= jQuery(function($) { $(".x-nav-wrap.mobile a").on( "touchend click", function() { $('.x-btn-navbar').click(); }); }); // Fixed Top Navbar on MOBILE - Breadcrumbs not visible // ============================================================================= jQuery(function($) { var $body = $('body'); var $navbar = $('.x-navbar'); if ( $body.hasClass('x-navbar-fixed-top-active') && $navbar.length > 0 ) { var boxedClasses = ''; if ( $body.hasClass('x-boxed-layout-active') ) { boxedClasses = ' x-container max width'; } $(window).scroll(function() { if ( $(this).scrollTop() >= 55 ) { $navbar.addClass('x-navbar-fixed-top' + boxedClasses); } else { $navbar.removeClass('x-navbar-fixed-top' + boxedClasses); } }); } });Now I would like to resolve an issue with Sub-voice of the MOBILE Menu:
http://prnt.sc/eknlkoWhen I click on a Menu-item with a sub-menu-item, the menu closes instead expand the sub-menu
Do you have any suggestions?
Is there any news about Best Practice on Fixed Top MOBILE Menu?
Thank You
March 16, 2017 at 4:27 pm #1410180
RadModeratorHi there,
Please implement the code mentioned here https://community.theme.co/forums/topic/mobile-nav-bar-3/page/2/#post-1408715
That should do it.
Cheers!
March 17, 2017 at 2:37 am #1410738
Gnomo BàgnoloParticipantHi Rad
thank You for your supportI’ve implemented the code suggested, but the issue seems to be NOT resolved.
Any ideas?
Thank You
March 17, 2017 at 10:07 am #1411088
JoaoModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks
March 17, 2017 at 10:29 am #1411118
Gnomo BàgnoloParticipantThis reply has been marked as private.March 17, 2017 at 10:20 pm #1411792
Rue NelModeratorHello There,
Thanks for providing the information. Please have this js code updated and make use of this code instead:
jQuery(function($) { $(".x-nav-wrap.mobile a").on( "touchend click", function(e) { if ( $(this).hasClass('menu-item-has-children') ) { e.preventDefault(); } else { $('.x-btn-navbar').click(); } }); });Hope this helps. Kindly let us know.
March 18, 2017 at 3:06 am #1411931
Gnomo BàgnoloParticipantHi There
Thank You for your support
I’ve updated my js code as suggested, but the result doesn’t change…
Mobile Menu always closes when I click an item, even if the item has children items
Please, try yourself ON MOBILE, with the item “IL TERRITORIO” that has two children:
– a Piedi
– in BiciWhen I click on “IL TERRITORIO” item, the Menu closes, instead of show me the two children items
Thank You again
March 18, 2017 at 7:57 pm #1412435
Rue NelModeratorHello There,
Thanks for updating in! By default, the menu will go to the link that is assigned to the menu item. Since your menu item has a submenu, it will go the link will not open the submenu. You have to hit the arrow down to be able to view the submenus. You might need to modify the code again and make use of this code:
// Fix if MOBILE Menu item has children // ============================================================================= jQuery(function($) { $(".x-nav-wrap.mobile a").on( "touchend click", function(e) { if ( $(this).parent('.menu-item').hasClass('menu-item-has-children') ) { //e.preventDefault(); console.log('with submenu'); } else { $('.x-btn-navbar').click(); console.log('no submenu') } }); });Please let us know if this works out for you.
March 19, 2017 at 7:21 am #1412708
Gnomo BàgnoloParticipantPERFECT !!!
Now it works fine !!!
Thank You very much Rue !!!
March 19, 2017 at 10:48 pm #1413201
Rue NelModeratorHey There,
You’re welcome! We are just glad we were able to help you out.
Thanks for letting us know that it has worked for you.Cheers.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1409479 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
