Modified Executive Committee page
This commit is contained in:
@@ -45,24 +45,27 @@ import vp_sec from '../assets/images/execomm/vp_sec.png';
|
|||||||
const cards = document.querySelectorAll(".photo-card img");
|
const cards = document.querySelectorAll(".photo-card img");
|
||||||
const closeBtn = document.querySelector(".close-modal");
|
const closeBtn = document.querySelector(".close-modal");
|
||||||
|
|
||||||
cards.forEach(img => {
|
// This simple check satisfies TypeScript's strict rules!
|
||||||
img.addEventListener("click", () => {
|
if (modal && closeBtn && modalImg) {
|
||||||
modal.style.display = "flex";
|
cards.forEach(img => {
|
||||||
modalImg.src = (img as HTMLImageElement).src;
|
img.addEventListener("click", () => {
|
||||||
document.body.style.overflow = "hidden"; // Prevent scrolling when open
|
modal.style.display = "flex";
|
||||||
|
modalImg.src = (img as HTMLImageElement).src;
|
||||||
|
document.body.style.overflow = "hidden"; // Prevent scrolling when open
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
closeBtn.addEventListener("click", () => {
|
closeBtn.addEventListener("click", () => {
|
||||||
modal.style.display = "none";
|
|
||||||
document.body.style.overflow = "auto";
|
|
||||||
});
|
|
||||||
|
|
||||||
// Close if user clicks outside the image
|
|
||||||
modal.addEventListener("click", (e) => {
|
|
||||||
if (e.target === modal) {
|
|
||||||
modal.style.display = "none";
|
modal.style.display = "none";
|
||||||
document.body.style.overflow = "auto";
|
document.body.style.overflow = "auto";
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
// Close if user clicks outside the image
|
||||||
|
modal.addEventListener("click", (e) => {
|
||||||
|
if (e.target === modal) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
document.body.style.overflow = "auto";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user