From c9f8f1f0aac7bd807d8813138ae81c425753da59 Mon Sep 17 00:00:00 2001 From: gelonspr Date: Fri, 8 Mar 2024 10:54:54 +0800 Subject: [PATCH] added minor fixes in modal image --- users/edit-kyc.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/users/edit-kyc.php b/users/edit-kyc.php index e94e3d1..6a825a2 100644 --- a/users/edit-kyc.php +++ b/users/edit-kyc.php @@ -192,10 +192,10 @@ } } - var captionText = document.getElementById("captionText"); + var modal = document.getElementById("myModal"); + function trigger(var1, caption) { - var modal = document.getElementById("myModal"); var modalImg = document.getElementById("img01"); modal.style.display = "block"; @@ -203,12 +203,11 @@ captionText.innerHTML = caption; } - var span = document.getElementsByClassName("close")[0]; - - - function closeModal() { - var modal = document.getElementById("myModal"); - modal.style.display = "none"; + // Close the modal when clicking outside the image + window.onclick = function(event) { + if (event.target == modal) { + modal.style.display = "none"; + } }