Created
May 19, 2021 06:10
-
-
Save m3l1nd4/229a00e72dbacea84a39af7b786e085e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Displaying Modal to Enlarge Image | |
$$(document).on('click', '.enlarge-image', function () { | |
const newCommentBtn = document.querySelector('#new-comment'); | |
const modal = document.querySelector('#enlarge-image'); | |
const modalImage = document.querySelector('#modal-image'); | |
const span = document.getElementsByClassName('close')[0]; | |
newCommentBtn.classList.add('display'); | |
modal.style.display = "block"; | |
modalImage.src = this.src; | |
span.onclick = () => { | |
modal.style.display = "none"; | |
newCommentBtn.classList.remove('display'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment