Sticky Mobile Navigation on scroll up > Mobile Navigation on Top disappears

Hey there

I tested some scripts to use the inbuilt Pro-Headers sticky navigation feature combined with a sticky on scroll up script I found in the forums here.

My questionis the following:

  • when you open a page on a smartphone like www.vida.gwdev.ch/yoga the navigation is on top.
  • if you begin scrolling down, the navigation is hidden.
  • if you begin scrolling up, the navigation re-appears
  • but when you reach the top, the navigation is hidden again and won´t appear which is annoying.

Can you please share a little hint on what I should change in my css or js code?

I added the css and js in the headers css & js:

(function($){
var iScrollPos = 0;
 
$(window).scroll(function () {
    var iCurScrollPos = $(this).scrollTop();
    if (iCurScrollPos > iScrollPos) {
        //Scrolling Down
        $('.sticky-scroll-up').addClass('hidden-away');
    } else {
       //Scrolling Up
       $('.sticky-scroll-up').removeClass('hidden-away');
    }

    if(document.body.scrollTop == 0) $('.x-navbar').removeClass('hidden-away');

    iScrollPos = iCurScrollPos;
});
})(jQuery);

and css

.sticky-scroll-up {
opacity: 1;
transition: all 0.3s ease !important;
}

.sticky-scroll-up.hidden-away {
opacity: 0;
z-index:1;
}

I´m pretty sure I messed something up in the css, but I don´t know what it is.
Or is this a known bug?

Feature request:
it would be awesome to have the ability to check a setting to get a clean inbuilt sticky on scroll up navigation setting. I guess that´s the only thing that´s missing in your awesome header-builder :wink:

Best regards and thanks in advance
Mike

Hi Mike,

Unfortunately, debugging a custom script goes beyond the scope of our support. As for the feature request, this is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive. Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.