diff options
author | Emruz Hossain <hossainemruz@gmail.com> | 2020-08-20 18:05:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 18:05:59 +0300 |
commit | 18a19d02d1ef08cafa246297493c92388d424bdc (patch) | |
tree | 356c52168049a49c1ba350d4f1b5cd48bc9eab3b | |
parent | 61a9d7aea0ccf0acab225212b8e6f2be2e6fafa1 (diff) |
Fix smooth scroll URL (#73)
-rw-r--r-- | static/assets/js/main.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/static/assets/js/main.js b/static/assets/js/main.js index d825d32..b12216d 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -24,7 +24,7 @@ var isMobile = false, isTablet = false, isLaptop = false; // ================= Smooth Scroll =================== function addSmoothScroll() { // Add smooth scrolling to all links - $("a").on('click', function (event) { + $('a[href*="#"]').on('click', function (event) { // Make sure this.hash has a value before overriding default behavior if (this.hash !== "") { @@ -47,9 +47,9 @@ var isMobile = false, isTablet = false, isLaptop = false; }, 800, function () { // Add hash (#) to URL when done scrolling (default click behavior) - window.location.hash = hash - offset; + window.location.hash = hash }); - } // End if + } }); } addSmoothScroll(); |