From d08bfbdcc0054050ba3153061aac892af6371359 Mon Sep 17 00:00:00 2001 From: sovanna Date: Mon, 20 Jan 2020 18:02:47 +0100 Subject: [PATCH] revert(mobile/shop): Hides menu when scroll down and shows when scroll up --- templates/_base.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/templates/_base.html b/templates/_base.html index 1b57d50..36ba8d1 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -218,14 +218,16 @@ var navbarSupportedContent = $('#navbarSupportedContent'); mywindow.scroll(function () { newscroll = mywindow.scrollTop(); - if (newscroll > mypos && !up) { - $('.container-header').stop().fadeOut(); - up = !up; - } else if(newscroll < mypos && up) { - $('.container-header').stop().fadeIn(); - up = !up; + if (!navbarSupportedContent.hasClass('show')) { + if (newscroll > (mypos + 30) && !up) { + $('.container-header').stop().fadeOut(); + up = !up; + } else if(newscroll < (mypos + 30) && up) { + $('.container-header').stop().fadeIn(); + up = !up; + } } - mypos = newscroll; + // mypos = newscroll; }); })();