From 14ec597b850f9614e7999ff272285ff34883043e Mon Sep 17 00:00:00 2001 From: sovanna Date: Mon, 20 Jan 2020 17:07:53 +0100 Subject: [PATCH] fix(mobile/menu): Hides menu when scroll down and shows when scroll up --- static/css/order-hardware.css | 16 ++++++++++++---- templates/_base.html | 16 +++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/static/css/order-hardware.css b/static/css/order-hardware.css index 0ef3027e..b8d43cc3 100644 --- a/static/css/order-hardware.css +++ b/static/css/order-hardware.css @@ -4,10 +4,6 @@ padding: 1em 1em 0; } -.dropdown-item { - font-size: .75em; -} - .simu-clone { z-index: 10; } @@ -175,6 +171,12 @@ ##Screen = B/w 481px to 767px */ @media (min-width: 481px) and (max-width: 767px) { + .dropdown-item { + font-size: .75em; + } + .sticky-top { + position: fixed; + } .logo > img { height: 20px; } @@ -353,6 +355,12 @@ ##Screen = B/w 320px to 479px */ @media (min-width: 320px) and (max-width: 480px) { + .dropdown-item { + font-size: .75em; + } + .sticky-top { + position: fixed; + } .logo > img { height: 20px; } diff --git a/templates/_base.html b/templates/_base.html index 36ba8d12..1b57d500 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -218,16 +218,14 @@ var navbarSupportedContent = $('#navbarSupportedContent'); mywindow.scroll(function () { newscroll = mywindow.scrollTop(); - 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; - } + if (newscroll > mypos && !up) { + $('.container-header').stop().fadeOut(); + up = !up; + } else if(newscroll < mypos && up) { + $('.container-header').stop().fadeIn(); + up = !up; } - // mypos = newscroll; + mypos = newscroll; }); })();