diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..23473e4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "gitea.repo": "ferienwohnung-wanderlust" +} \ No newline at end of file diff --git a/script.js b/script.js index e93784c..cfd48d0 100644 --- a/script.js +++ b/script.js @@ -20,14 +20,12 @@ document.addEventListener('DOMContentLoaded', function () { } } - var hashAnchors = document.querySelectorAll("a[href^='#']"); + var hashAnchors = document.querySelectorAll("a[href^='#']:not([href='#'])"); for (var i = 0; i < hashAnchors.length; i++) { - if (hashAnchors[i].getAttribute("href") != "#") { - hashAnchors[i].onclick = function () { - var target = this.getAttribute("href"); - scrollToElement(target); - return false; - } + hashAnchors[i].onclick = function () { + var target = this.getAttribute("href"); + scrollToElement(target); + return false; } }