fixed x button on modal image
This commit is contained in:
parent
6cb4c0b4d2
commit
a6f7b8cec0
|
@ -206,7 +206,6 @@ $BearerToken = $_SESSION['token'];
|
||||||
|
|
||||||
var modal = document.getElementById("myModal");
|
var modal = document.getElementById("myModal");
|
||||||
|
|
||||||
|
|
||||||
function trigger(var1, caption) {
|
function trigger(var1, caption) {
|
||||||
var modalImg = document.getElementById("img01");
|
var modalImg = document.getElementById("img01");
|
||||||
|
|
||||||
|
@ -215,9 +214,9 @@ $BearerToken = $_SESSION['token'];
|
||||||
captionText.innerHTML = caption;
|
captionText.innerHTML = caption;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the modal when clicking outside the image
|
// Close the modal when clicking outside the image or x button
|
||||||
window.onclick = function(event) {
|
window.onclick = function(event) {
|
||||||
if (event.target == modal) {
|
if (event.target == modal || event.target.classList.contains('closeImg')) {
|
||||||
modal.style.display = "none";
|
modal.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue