Menu on mobile disappears when sliding down

Hi team!

Thank you for creating this wonderful theme.

I’m optimising my website for mobile at the moment and it made me realise that whenever I slide down, the top menu disappears. This isn’t a problem at all, but is it possible to make the menu show up again when sliding a little bit up? The website is: www.cabincrewexit.com

Sorry if this has been asked before already! I’ve been searching for an answer on this subject but couldn’t find it.

Mirthe

Hello Mirthe,

Try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.

    @media only screen and (max-width: 1024px) {
      .site-header.float-header {
        position: fixed !important;
      }
    } 

Regards,
Kharis

Wow! That’s amazing!
Thanks a lot!

Is there also an option that the menu disappears when sliding down, but comes back when sliding up?

Best regards,

Mirthe

Hello there,

Please try doing the below steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    ;(function($) {

      if ( matchMedia( 'only screen and (max-width: 1024px)' ).matches ) {

        var previousScroll = 190;
        $(window).on('load scroll', function(event) {

           var scroll = $(this).scrollTop();

           if (scroll > previousScroll){

               clearTimeout($.data(this, 'scrollTimer'));
               $.data(this, 'scrollTimer', setTimeout(function() {

                   $('.site-header.float-header').animate({
                    'top': '-200px'
                   }, 70);

               }, 250));

           } else {

              $('.site-header.float-header').animate({
               'top': '0px'
              }, 20);

           }

           previousScroll = scroll;

        });

      }

    })(jQuery);
  1. Update

Regards,
Kharis

Amazing! Thank you so so much Kharis.
It is not sliding super smooth, but it will definitely do the job and will make my website more mobile friendly.

Thanks again!

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis