Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #270902

    Dave K
    Participant

    I’m trying to set up a one page with anchors. I think I’ve done so but on the mobile menu, when selecting a menu item, the menu doesn’t close automatically. I’ve added some javascript to the customizer that I found on another support post but it isn’t working …

    http://192.185.115.245/~geometrik/

    #271071

    Nico
    Moderator

    Hi There,

    Thanks for writing in. As we checked your site, it is working well.

    Would you mind sharing us your admin credential so we could take a closer look on your setup and share us also the added script that you added.

    Don’t forget to set it as private reply.

    Thanks.

    #271520

    Dave K
    Participant

    It seems to be working for me now also … It must have been a cache issue.

    #271619

    Thai
    Moderator

    Great. Glad you’ve sorted it out.

    #289075

    Dave K
    Participant

    So I’ve checked this on the iphone 6 and it does not close when I click on a menu item. Any suggestions?

    #289617

    Christopher
    Moderator

    Hi there,

    Please add the following CSS under Customize -> Custom -> JavaScript :

    (function($){
      $('.x-navbar .x-nav-wrap.mobile a').click(function(){
        $('.x-nav-wrap.mobile').toggleClass('in').css('height', 0);
        $('.x-btn-navbar').toggleClass('collapsed');
      });
    });

    Hope it helps.

    #289873

    Dave K
    Participant

    That didn’t seem to work … the menu will not close when it is clicked automatically on the iphone. When I resize on the browser to mobile, it won’t work either.

    #290575

    Christopher
    Moderator

    Hi there,

    I’m sorry, please try this code :

    (function($){
      $('.x-navbar .x-nav-wrap.mobile a').click(function(){
        $('.x-nav-wrap.mobile').toggleClass('in').css('height', 0);
        $('.x-btn-navbar').toggleClass('collapsed');
      });
    })(jQuery);

    This one should work.

    Thanks.

    #293536

    Dave K
    Participant

    Hi, this still is not working on an iphone 6 … It works fine when I resize the browser on a desktop computer (Windows), but when testing it on an iphone 6, the menu does not close.

    #294178

    Rad
    Moderator

    Hi Dave,

    It’s a bug betweem IOS and our theme, which I already forwarded as bug before. It seems like there is something that blocks the click event on IOS.

    I even performed the simple test,

    jQuery('.x-navbar .x-nav-wrap.mobile a').on('click',function(){ console.log('clicked');});

    That should output ‘clicked’, but it’s not.

    Please don’t use fixed positioning for your navigation for now.

    Thanks!

    #752397

    fused180
    Participant

    Hey there …is there any solution on this? We are running into the same issue.

    j

    #752432

    Paul R
    Moderator

    Hi J,

    You can try this code

    
    (function($){
      $('.x-navbar .x-nav-wrap.mobile a').on( "click touchend", function(){
        $('.x-nav-wrap.mobile').toggleClass('in').css('height', 0);
        $('.x-btn-navbar').toggleClass('collapsed');
      });
    })(jQuery);
    

    Hope that helps.