added nodejs-boilerplate; modalImgShow() fully integrated

This commit is contained in:
2020-03-30 11:28:48 +02:00
parent 06493f69a1
commit a0485a3f6c
2 changed files with 120 additions and 101 deletions

View File

@@ -2,13 +2,13 @@
var modal = document.getElementById("myModal");
var modalImg = document.getElementById("modalImage1");
function modalImg() {
function myModalShowImg(picture) {
modal.style.display = "block";
modalImg.src = this.src;
modalImg.src = picture.getElementsByClassName("cert-img")[0].src;
}
// When the user clicks on <span> (x), close the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x) or the picture, close the modal
var span = document.getElementsByClassName("close")[0] && document.getElementsByClassName("modal-content")[0];
span.onclick = function () {
modal.style.display = "none";
};