fixed bug that didn't close modal on X span
This commit is contained in:
parent
c536859441
commit
5b1951b48a
@ -8,7 +8,12 @@ function myModalShowImg(picture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When the user clicks on <span> (x) or the picture, close the modal
|
// When the user clicks on <span> (x) or the picture, close the modal
|
||||||
var span = document.getElementsByClassName("close")[0] && document.getElementsByClassName("modal-content")[0];
|
var span = document.getElementsByClassName("close")[0];
|
||||||
span.onclick = function () {
|
span.onclick = function () {
|
||||||
modal.style.display = "none";
|
modal.style.display = "none";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var picture = document.getElementsByClassName("modal-content")[0];
|
||||||
|
picture.onclick = function () {
|
||||||
|
modal.style.display = "none";
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user