diff options
author | Noritaka IZUMI <38166104+noritakaIzumi@users.noreply.github.com> | 2020-11-13 20:51:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 20:51:58 +0300 |
commit | 6c03dd74af6b620c299f23eb63250ce5130e1a75 (patch) | |
tree | 11a704fcc1ddb24bb656d19ea6df0da7d894946b | |
parent | 38fdbbfbdb049c0d6dbaf0d95555ac02aae986a2 (diff) |
Fix smooth scroll (#164)
The function addSmoothScroll causes an error if a target link contains multibyte characters.
Decoding `this.hash` can prevent.
-rw-r--r-- | static/assets/js/main.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/static/assets/js/main.js b/static/assets/js/main.js index c02f237..47c0886 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -37,7 +37,7 @@ var isMobile = false, isTablet = false, isLaptop = false; location.hostname == this.hostname ) { // Figure out element to scroll to - var target = $(this.hash); + var target = $(decodeURI(this.hash)); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); // Does a scroll target exist? if (target.length) { |