diff --git a/event5.js.20230125 b/event5.js.20230125 new file mode 100644 index 0000000..2cdc2b2 --- /dev/null +++ b/event5.js.20230125 @@ -0,0 +1,22 @@ +// document.addEventListener("DOMContentLoaded", (e) => { +// for (let id of ["station", "miraini", "koryo", "sankyo", "siyakusyo","moyasikun",]) { +// document.getElementById(id).addEventListener("markerFound", +// (e) => { +// document.getElementById("vr-"+id).classList.remove("notfound"); +// }); +// } +// }); + +document.addEventListener("DOMContentLoaded", marker_found_init); + +function marker_found_init(){ + for (let id of ["station", "miraini", "koryo", "sankyo", "siyakusyo"]) { + document.getElementById(id).addEventListener("markerFound", (e) => + { + for (let id2 of ["station", "miraini", "koryo", "sankyo", "siyakusyo"]) { + document.getElementById("vr-"+id2).classList.add("notfound"); + } + document.getElementById("vr-"+id).classList.remove("notfound"); + }); + } +}