From eee9dd5fe6a057271d56c86535903eaf61e76774 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Tue, 18 Oct 2022 12:48:35 +0100 Subject: [PATCH] Add js to control new_menu --- js/navbar.js | 11 +++++++++++ new_index.html | 4 ++-- style/new_menu.css | 20 +++++++++++++++----- style/new_style.css | 10 +++++++--- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/js/navbar.js b/js/navbar.js index 7788096..f3fad33 100644 --- a/js/navbar.js +++ b/js/navbar.js @@ -4,4 +4,15 @@ function inflateSidebar() { function collapseSidebar() { document.getElementById("sidebar").style.width = "0px"; +} + +function sidebarToggle() { + var bar = document.getElementById("sidebar"); + if (bar.style.height === "0") { + bar.style.height = "100%"; + bar.style.display = "block"; + } else { + bar.style.height = "0"; + bar.style.display = "none"; + } } \ No newline at end of file diff --git a/new_index.html b/new_index.html index 397a790..f8a040f 100644 --- a/new_index.html +++ b/new_index.html @@ -25,8 +25,8 @@