From 04e593565d0f69ec54923fb66a167eecc48f6e50 Mon Sep 17 00:00:00 2001 From: Simone Bortolin Date: Fri, 5 Aug 2022 06:59:56 +0200 Subject: update theme update update update fix js fix js bug update update css and js fix update js update fix scss update style update style update style update style update and add some new template update update fix update alert update fix color fix color Create LICENCE Create README.md add privacy policy and homepage update fix link Create ont-D-LINK-DPN-100-Rev-C1.md Create ont-huawei-cm5671a.md Update ont-huawei-ma5671a.md Update ont-nokia-g-s010s-p.md Update ont-nokia-g-s010s-p.md Update ont-Sercomm-FGS202.md Update index.md update update tables update fix iframe add new tool for ascii-hex converter update things update figure css Update ont-D-LINK-DPN-100-Rev-C1.md fix css --- assets/js/modal.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 assets/js/modal.js (limited to 'assets/js') diff --git a/assets/js/modal.js b/assets/js/modal.js new file mode 100644 index 0000000..2cae945 --- /dev/null +++ b/assets/js/modal.js @@ -0,0 +1,26 @@ +var modals = document.querySelectorAll("[data-modal]"); +var modalToogles = document.querySelectorAll("[data-toogle=modal]"); + + +[...modals].forEach(modal => { + var closeBtns = modal.getElementsByClassName("close"); + [...closeBtns].forEach(closeBtn => { + closeBtn.addEventListener("click", (event) => { + modal.style.display = "none"; + }); + }) +}); + +[...modalToogles].forEach(toogle => { + toogle.addEventListener("click", (event) => { + var modal = document.querySelector(toogle.getAttribute('data-target')); + modal.style.display = "block"; + }); +}); + +window.addEventListener("click", function(event) { + if ([...modals].includes(event.target)) { + event.target.style.display = "none"; + } +}); + -- cgit v1.2.3