Skip to content

Commit

Permalink
Update app.js for modal
Browse files Browse the repository at this point in the history
  • Loading branch information
lisztomania23 authored Oct 28, 2023
1 parent aa0f259 commit 0b06920
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,27 @@ main.addEventListener('click', function () {
audio.addEventListener('ended', function () {
audio.src = "music/KQEJO-emphasis.mp3";
audio.play();
});
});



// for modal

$(document).ready(function () {
// Open the modal
$(".btn, .xplore").click(function () {
$(".modal-wrapper").addClass("open");
});

// Close the modal on clicking the close button
$(".btn-close").click(function () {
$(".modal-wrapper").removeClass("open");
});

// Close the modal when clicking outside of it
$(".modal-wrapper").click(function (event) {
if (event.target === this) {
$(this).removeClass("open");
}
});
});

0 comments on commit 0b06920

Please sign in to comment.