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
Best regards and thanks in advance
Mike