Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1173104
    thelistener
    Participant

    Hi there! Did I mention how much I love X?????

    Anyways, I was trying to find a way to make the mobile menu sticky (CLICK HERE TO SEE THE SITE I’M WORKING ON!) and found and inserted this code into the customizer:

    CSS:

    @media (max-width: 979px) {
    .x-navbar-fixed-top {
    position: fixed !important;
      background: rgb(52,152,219);
    }

    JS:
    (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);`

    The problem I’m facing now is that when you click/tap on services, the menu collapses. What I need is for the submenu to appear and the menu only to collapse when someone scrolls down, or taps on an item in the submenu.

    #1173196
    Thai
    Moderator

    Hi There,

    Please remove this JS:

    (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);

    Hope it helps 🙂

    #1174235
    thelistener
    Participant

    you see, i tried that and what happens is that the open menu stays open if you scroll down.

    I just don’t want the entire menu to collapse when you tap/select the “services” dropdown.

    #1174503
    Paul R
    Moderator

    Hi,

    Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    #1177129
    thelistener
    Participant

    Paul, no worries. I realize now removing the javascript was the right course of action. I truly appreciate your help!

    #1177156
    Nico
    Moderator

    Feel free to ask us again.

    Thanks.

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