Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function zoomImage(e) {
- // Get the modal
- var modal = document.querySelector(".modal-image");
- var modalImg = modal.querySelector(".modal-content");
- console.log(modal, modalImg);
- modal.style.display = "block";
- modalImg.src = e.target.src;
- // Get the <span> element that closes the modal
- var span = modal.querySelector(".close");
- // When the user clicks on <span> (x), close the modal
- span.onclick = function () {
- modal.style.display = "none";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement