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

    fictionadmin
    Participant

    hi there!
    have the problem that the top nav bar on mobil is not working fine.
    after selecting menu button the menu open but the menu dont close automaticly after selecting menu link?. In the Cornerstone editor preview its working but not on live.
    Can u help please. Found some older post here with customized js but it wont work in my theme…

    Thanks!
    Alex

    #768684

    fictionadmin
    Participant
    This reply has been marked as private.
    #769072

    Rupok
    Member

    Hi there,

    Thanks for writing in! It seems you have forced the mobile Navbar to be fixed with the following custom code –

    .x-navbar-fixed-top {
      position: fixed !important;
    }

    Please remove this to get expected result.

    Cheers!

    #770484

    fictionadmin
    Participant

    Hey!
    Its right when i remove the code its working. But than i have the problem that the top nav bar on mobile is not visible after selecting a menu point and scrolling down. its not so cool beacause if u want to use the menu again u have to scroll to top again every time

    how can i do booth? fixing the top nav bar mobile and have normal menu function (close after selecting) ?

    thanks again!

    #771031

    Jade
    Moderator

    Sorry for that.

    Please add this code in the customizer instead:

    @media screen and (max-width: 979px){
        .x-navbar-fixed-top {
            position: relative !important;
        }
    }

    Hope this helps.

    #773267

    fictionadmin
    Participant

    hi! i added the code insted the other but unfortunately nothing changed.
    can u check again? The menu on mobil do not close after selecting a link.
    and its not fixed on top. thanks.

    #773661

    Rupok
    Member

    Hi there,

    Sorry for the confusion. The above code was not to do those rather override your conflicting codes. However the menu does not supposed to close on click by default. You can add this under Custom > JavaScript in the Customizer.

    jQuery(document).ready(function($){
    	$('.menu-item a').click(function(){
    		$('.x-nav-wrap.mobile').removeClass('in');
    	});
    });

    Hope this helps.

    Cheers!

    #775791

    fictionadmin
    Participant

    can u check it again. added the code in customize – java. but nothing changed.
    the menu is still open after selecting menu point.

    i also removed this css but nothing changed.
    .x-navbar-fixed-top {
    position: fixed !important;
    }

    the problem on mobil is that u cant use it when the menu stays open & fixed on top.
    if its not fixed on top u have to scroll back to top always than u get in the area where the menu is and u select automaticly a link that u dont want…

    a bit confused now sorry. there must be a way to fix this problem or?

    thanks again!
    alex

    pic from mobil menu

    #775793

    fictionadmin
    Participant
    This reply has been marked as private.
    #775845

    Paul R
    Moderator

    Hi,

    Thank you for providing your login credentials.

    You can try this code instead

    
    jQuery(document).ready(function($){
    	$('.x-nav-wrap.mobile .x-nav a').on( "click touchstart", function() {
    		$('.x-nav-wrap.mobile').removeClass('in');
    	});
    });
    

    Hope that helps.

    #779747

    fictionadmin
    Participant

    oh yes now it works! thanks!
    happy here!
    best
    alex

    #780342

    Nabeel A
    Moderator

    Glad we could help 🙂

    Cheers!