mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
fix: anchor link need decode (#719)
This commit is contained in:
parent
ff7a56a7ac
commit
3ff06fe033
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ function setupSmoothAnchors() {
|
|||
aElement.addEventListener("click", clickEvent => {
|
||||
clickEvent.preventDefault();
|
||||
|
||||
const targetId = aElement.getAttribute("href").substring(1),
|
||||
const targetId = decodeURI(aElement.getAttribute("href").substring(1)),
|
||||
target = document.getElementById(targetId) as HTMLElement,
|
||||
offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top;
|
||||
|
||||
|
|
Loading…
Reference in a new issue