Skip to content

Commit

Permalink
Fermeture de la modale
Browse files Browse the repository at this point in the history
  • Loading branch information
h-khribich committed Jun 19, 2021
1 parent b3441d7 commit 7a4baec
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function editNav() {
const modalbg = document.querySelector(".bground");
const modalBtn = document.querySelectorAll(".modal-btn");
const formData = document.querySelectorAll(".formData");
const modalClosebtn = document.querySelector(".close");
const modalClosebtn = document.querySelector(".content > .close");

// Launch modal event
modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
Expand All @@ -20,26 +20,13 @@ modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
function launchModal() {
modalbg.style.display = "block";
};
/*
//Array.from(modalClosebtn).forEach((btn) => btn.addEventListener("click", closeModal));

console.log(modalClosebtn);
// Close modal form
modalCloseBtn.addEventListener("click", closeModal());
function closeModal() {
// Close modal event and form
modalClosebtn.addEventListener("click", function() {
modalbg.style.display = "none";
};
});

console.log(modalClosebtn);


/*
modalCloseBtn.forEach((btn) => btn.addEventListener("click", closeModal));
function closeModal() {
modalbg.style.display = "none";
};
*/

//validate()

0 comments on commit 7a4baec

Please sign in to comment.