diff options
| -rw-r--r-- | layouts/partials/footer.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b94ace0..f3baf82 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -30,8 +30,8 @@ document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener("click", function (e) { e.preventDefault(); - - document.querySelector(this.getAttribute("href")).scrollIntoView({ + var id = this.getAttribute("href").substr(1); + document.querySelector(`[id='${id}']`).scrollIntoView({ behavior: "smooth" }); }); |
