Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/ts/smoothAnchors.ts')
-rw-r--r--assets/ts/smoothAnchors.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/assets/ts/smoothAnchors.ts b/assets/ts/smoothAnchors.ts
index 0718bf5..379eb39 100644
--- a/assets/ts/smoothAnchors.ts
+++ b/assets/ts/smoothAnchors.ts
@@ -23,7 +23,7 @@ function setupSmoothAnchors() {
let targetId = aElement.getAttribute("href").substring(1);
// The replace done on ':' is here for footnotes, as this character would otherwise interfere when used as a CSS selector.
- let target = document.querySelector(`#${targetId.replace(":", "\\:")}`) as HTMLElement;
+ let target = document.getElementById(targetId.replace(":", "\\:")) as HTMLElement;
window.history.pushState({}, "", aElement.getAttribute("href"));
scrollTo({ top: target.offsetTop, behavior: "smooth" });