revert(mobile/shop): Hides menu when scroll down and shows when scroll up

This commit is contained in:
sovanna 2020-01-20 18:02:47 +01:00
parent e96c0dc524
commit d08bfbdcc0
1 changed files with 9 additions and 7 deletions

View File

@ -218,14 +218,16 @@
var navbarSupportedContent = $('#navbarSupportedContent'); var navbarSupportedContent = $('#navbarSupportedContent');
mywindow.scroll(function () { mywindow.scroll(function () {
newscroll = mywindow.scrollTop(); newscroll = mywindow.scrollTop();
if (newscroll > mypos && !up) { if (!navbarSupportedContent.hasClass('show')) {
$('.container-header').stop().fadeOut(); if (newscroll > (mypos + 30) && !up) {
up = !up; $('.container-header').stop().fadeOut();
} else if(newscroll < mypos && up) { up = !up;
$('.container-header').stop().fadeIn(); } else if(newscroll < (mypos + 30) && up) {
up = !up; $('.container-header').stop().fadeIn();
up = !up;
}
} }
mypos = newscroll; // mypos = newscroll;
}); });
})(); })();
</script> </script>