aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-14 05:15:03 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-14 05:15:03 -0500
commitc147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e (patch)
tree95a1be0dbebe7c5eec6df9d33a3d735305f57ce1
parentecc1d9c9d843b56a478117dd45e676800f3225eb (diff)
downloadthedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.tar.gz
thedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.tar.bz2
thedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.zip
public/js/app: Correct scroll logic
-rw-r--r--public/js/app.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/js/app.js b/public/js/app.js
index a7ccbca..059c355 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -87,13 +87,15 @@ window.addEventListener('scroll', function() {
settings['pager'][url] = currentPosition;
localStorage['settings'] = JSON.stringify(settings);
- if ((scrolls > 3 && velocity > 75) || currentPosition < navbarHeight) {
+ if (scrolls > 3) {
+ if (velocity > 75 || currentPosition < navbarHeight) {
remClass(navbar, 'hide');
} else if (velocity < -25) {
addClass(navbar, 'hide');
} else if (currentPosition > navbarHeight) {
runOnce(function () { addClass(navbar, 'hide'); });
}
+ }
previousPosition = currentPosition;
scrolls++;