-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (19 loc) · 702 Bytes
/
script.js
File metadata and controls
21 lines (19 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Toggle between showing and hiding the navigation menu links when the user clicks on the hamburger menu / bar icon */
function myFunction() {
var x = document.getElementById("myLinks");
if (x.style.display === "grid") {
x.style.display = "none";
} else {
x.style.display = "grid";
}
};
function expandImage(img) {
const modal = document.getElementById("imageModal");
const expandedImg = document.getElementById("expandedImg");
modal.style.display = "flex"; // Show the modal
expandedImg.src = img.src; // Set the source of the expanded image
}
function closeModal() {
const modal = document.getElementById("imageModal");
modal.style.display = "none"; // Hide the modal
}