diff options
author | Thedro Neely <thedroneely@gmail.com> | 2022-11-14 05:15:03 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2022-11-14 05:15:03 -0500 |
commit | c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e (patch) | |
tree | 95a1be0dbebe7c5eec6df9d33a3d735305f57ce1 /public | |
parent | ecc1d9c9d843b56a478117dd45e676800f3225eb (diff) | |
download | thedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.tar.gz thedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.tar.bz2 thedroneely.com-c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e.zip |
public/js/app: Correct scroll logic
Diffstat (limited to 'public')
-rw-r--r-- | public/js/app.js | 4 |
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++; |