From fb6dff6938a23e15f5a1432f0c50f6bd2bec6634 Mon Sep 17 00:00:00 2001 From: yuchan Date: Tue, 28 Apr 2020 12:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=A9=9F=E7=89=88=20navbar=20?= =?UTF-8?q?=E9=81=B8=E5=96=AE=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- index.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 index.js diff --git a/index.html b/index.html index f3352be..b82d996 100755 --- a/index.html +++ b/index.html @@ -125,7 +125,7 @@

--> + diff --git a/index.js b/index.js new file mode 100644 index 0000000..00704c6 --- /dev/null +++ b/index.js @@ -0,0 +1,7 @@ +let btn = document.querySelector("#navbar-burger"); +let menu = document.querySelector("#navbar-menu") + +btn.addEventListener("click", function (e) { + e.preventDefault(); + menu.classList.toggle("is-active"); +}) \ No newline at end of file