Код: Выделить всё
Admin
< /code>
Я хочу, чтобы, когда вы нажимаете на карту, отображается модальный.var infomodal = document.getElementById("info-modal");
// Get the button that opens the modal
var infobtn = document.getElementsByClassName("Info-btn")[0];
// Get the element that closes the modal
var infospan = document.getElementsByClassName("infoclose")[0];
// When the user clicks the button, open the modal
infobtn.addEventListener("click", function(){
infomodal.style.display = "block";
})
// When the user clicks on (x), close the modal
infospan.addEventListener("click", function(){
infomodal.style.display = "none";
})
// When the user clicks anywhere outside of the modal, close it
window.addEventListener("click", function(event){
if (event.target == infomodal) {
infomodal.style.display = "none";
}
})
Подробнее здесь: https://stackoverflow.com/questions/765 ... yclassname