Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1173174
    aceven24
    Participant

    Hello,

    I tried adding this piece of code to collapse the mobile menu when clicking on a item, it worked fine, but I have one menu item that has sub items, what changes do I need to make to the code to not do it on menu items that have sub items?

    The site is https://revivernyc.com

    jQuery(document).ready(function($){
    $(‘.x-nav-wrap.mobile .x-nav a’).on( “click touchstart”, function() {
    $(‘.x-nav-wrap.mobile’).removeClass(‘in’);
    });
    });

    #1173499
    Rupok
    Member

    Hi there,

    Let’s try updating the code :

    jQuery(document).ready(function($){
      $('.x-nav-wrap.mobile .x-nav li:not(.menu-item-has-children) a').on( "click touchstart", function() {
      $('.x-nav-wrap.mobile').removeClass('in');
    });
    });

    Hope this helps.

    #1174827
    aceven24
    Participant

    Perfect thanks for the awesome response time!

    #1174945
    Thai
    Moderator

    You’re most welcome 🙂

  • <script> jQuery(function($){ $("#no-reply-1173174 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>