From 7dc3232ce4801b0ef2a44157ddbe0a62be97f288 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 22 Apr 2020 22:21:43 +0200 Subject: [PATCH] [TASK] Navigation auf kleinen Displays fixes #6 --- index.html | 11 +++++++++-- script.js | 14 ++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 88eb56f..6a6f026 100644 --- a/index.html +++ b/index.html @@ -20,10 +20,12 @@ +
diff --git a/script.js b/script.js index c6aad63..e93784c 100644 --- a/script.js +++ b/script.js @@ -9,6 +9,9 @@ document.addEventListener('DOMContentLoaded', function () { interval: 5000 }); + var elems = document.querySelectorAll('.sidenav'); + var sidenav = M.Sidenav.init(elems, {}); + var mailcypts = document.querySelectorAll(".cryptmail"); for (var i = 0; i < mailcypts.length; i++) { mailcypts[i].onclick = function () { @@ -19,11 +22,14 @@ document.addEventListener('DOMContentLoaded', function () { var hashAnchors = document.querySelectorAll("a[href^='#']"); for (var i = 0; i < hashAnchors.length; i++) { - hashAnchors[i].onclick = function () { - var target = this.getAttribute("href"); - scrollToElement(target); - return false; + if (hashAnchors[i].getAttribute("href") != "#") { + hashAnchors[i].onclick = function () { + var target = this.getAttribute("href"); + scrollToElement(target); + return false; + } } + } });