From 6972bebf93f8dcbd3f22b0e31d9a280ce4aa7833 Mon Sep 17 00:00:00 2001 From: JoanaChicau Date: Tue, 25 May 2021 16:46:18 +0200 Subject: [PATCH] added script to end of HTML now reading mobile sidemenu function --- index.html | 5 +++++ narrowscripts.js | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 71c7563..d99f076 100644 --- a/index.html +++ b/index.html @@ -250,5 +250,10 @@ + + + + + diff --git a/narrowscripts.js b/narrowscripts.js index e852737..1f0f38e 100644 --- a/narrowscripts.js +++ b/narrowscripts.js @@ -43,19 +43,20 @@ $(function() { } +// SCRIPT MOBILE SIDEMENU HIDE + + var x = window.matchMedia("(max-width: 768px)") + function fsidemobile(x) { - if (x.matches) { // If media query matches - var element = document.getElementById("side"); - element.classList.toggle("sideminclicked"); - } else { - element.classList.toggle(""); + if (x.matches) { // If media query matches + var element = document.getElementById("side"); + element.classList.toggle("sideminclicked"); + } else { + element.classList.toggle(""); + } } - } - var x = window.matchMedia("(max-width: 768px)") fsidemobile(x) - x.addListener(fsidemobile) - function hideshowWelcome() {