// ############################################################################ // # # // # Description: JS utile un peu de partout # // # # // ############################################################################ // Site web utilisés pour JS: // https://www.w3schools.com/js/default.asp // https://stackoverflow.com/ // **************************************************************************** // CHANGEMENT DE LANGUE // **************************************************************************** document.getElementById("navSelLang").addEventListener("change", () => { document.getElementById("navFormLang").submit(); }); // **************************************************************************** // TOGGLE UNE CLASSE SUR UN ELEMENT PARMIS PLUSIEURS IDENTIQUES // **************************************************************************** function show(parentId, element, id, className) { let elements = document.getElementById(parentId).getElementsByTagName(element); elements[id].classList.add(className); for (i = 0; i < elements.length; i++) { if (elements[i].id !== id) { elements[i].classList.remove(className); } } } // **************************************************************************** // AFFICHER LA BAR DE NAVIGATION // **************************************************************************** function showNavButtons() { document.getElementsByTagName("nav")[0].classList.toggle("showNav") // first-child à chaque fois document.getElementsByTagName("header")[0].getElementsByTagName("a")[0].getElementsByTagName("i")[0].classList.toggle("navLinkClicked") }