Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1035485
    codecompany
    Participant

    I cant seem to get my mobile menu to close after clicking on a link. I tried some of the js I found on here but no luck. I did you this code so that I have all my link hrefs correct http://theme.co/x/member/forums/topic/nav-bar-not-fully-working-on-1-page-scrolling/#post-45754 but now all the links are highlighted when you are in full screen as the beginning of the each urls are all the same.

    #1035629
    Lely
    Moderator

    Hi There,

    Please check this link for some guide:https://community.theme.co/kb/how-to-setup-one-page-navigation/
    Make sure that under Page Settings > One Page Navigation: You have selected your menu under the dropdown. This will prevent multiple links to be highlighted. Then check the code suggested here:https://community.theme.co/forums/topic/mobile-menu-doesnt-close-when-selecting-scroll-link/#post-229038 to close it for mobile.

    Hope this helps.

    #1036165
    codecompany
    Participant

    Hey Thank you works great on my computer, however it doesn’t seem to work on my phone. Also I tried to add a line that will also close the menu if the body is clicked. I tried variances of the following with no luck: .entry-content .content .x-main .full

    #1036561
    Jade
    Moderator

    Hi there,

    Kindly provide is with your site’s URL so that we could check it. Thanks!

    #1036568
    codecompany
    Participant
    This reply has been marked as private.
    #1036978
    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the url of your site. I have tested your site on my mobile phone and I could not replicate the issue. Would you mind clearing your mobile phone’s browser cache? And if you are using CloudFlare or may have installed a caching plugin like WordFence, W3 Total Cache or WP Super Cache, please keep in mind that after doing every updates or making any changes, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

    Please let us know how it goes.

    #1037509
    codecompany
    Participant

    Hello I cleared my phones cache, as well as tried it on my ipad that I haven’t used on the site yet. And the menu still does not close when a link is clicked. I am not using CloudFlare or have any caching plugins installed.

    #1037822
    Rue Nel
    Moderator

    Hello There,

    You have implemented the one page navigation incorrectly. You should create two separate menus. One menu should be your primary menu and the other one is exclusively for your one page navigation menu. Right now, the menu items are being highlighted. This menu should only be used exclusively for the homepage or your one page nagivation. To know more about how to implement one page navigation menu, please check out our knowledge base here: https://community.theme.co/kb/how-to-setup-one-page-navigation/

    Hope this helps.

    #1037831
    codecompany
    Participant

    Hello,

    I changed the menu so that I do not have the problem with the links staying highlighted. But the menu still does not collapse on my mobile devices, it does on my desktop but not on mobile.

    #1037977
    Rue Nel
    Moderator

    Hi There,

    To resolve the mobile menu issue, please update the JS code and make use of this code instead:

    (function($) {
        $('.x-navbar .x-nav-wrap.mobile a, .entry-content .content').on('click touchstart', function() {
            $('.x-btn-navbar').toggleClass('collapsed');
        })
    })(jQuery);

    Please let us know if this works out for you.

    #1038316
    codecompany
    Participant

    Hello,

    It does the same, it works on my computer but not on my mobile devices.

    #1038694
    Rue Nel
    Moderator

    Hello There,

    I do not see the code on the page. All I see is your old code that you have added. If you already removed it, could you please add it back again so that we could thoroughly test it. And by the way, before testing it in your mobile phone, please clear your phone’s browser cache or use Chrome’s incognito mode or Safari’s private browsing mode.

    Please let us know how it goes.

    #1038948
    codecompany
    Participant

    Sorry I put the code back in.

    #1039117
    Rue Nel
    Moderator

    Hello There,

    Could please update the JS code and test again?

    (function($) {
      $(window).load(function(){
        $('.x-navbar .x-nav-wrap.mobile a, .entry-content .content').on('click touchend', function() {
            $('.x-btn-navbar').trigger('click');
        })
      });
    })(jQuery);

    Please let us know if this works out for you.

    #1040284
    codecompany
    Participant

    AWESOME!! Works perfect. Thank you

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