Skip to content

Commit

Permalink
Fix TODO : fermer la modale OpenClassrooms-Student-Center#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Wewill committed Sep 3, 2024
1 parent 380d151 commit 157b8ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
starterOnly/.DS_Store
2 changes: 1 addition & 1 deletion starterOnly/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1 class="hero-headline">

<div class="bground">
<div class="content">
<span class="close"></span>
<span class="close close-btn"></span>
<div class="modal-body">
<form
name="reserve"
Expand Down
9 changes: 9 additions & 0 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function editNav() {
// DOM Elements
const modalbg = document.querySelector(".bground");
const modalBtn = document.querySelectorAll(".modal-btn");
const modalCloseBtn = document.querySelectorAll(".close-btn");
const formData = document.querySelectorAll(".formData");

// launch modal event
Expand All @@ -20,4 +21,12 @@ function launchModal() {
modalbg.style.display = "block";
}

// close modal event
modalCloseBtn.forEach((btn) => btn.addEventListener("click", closeModal));

// close modal form
function closeModal() {
modalbg.style.display = "none";
}


0 comments on commit 157b8ad

Please sign in to comment.