Torna su
// Get the modal let modal; // Get the element that closes the modal var span; // When the user clicks on the button, open the modal function openModal(id) { modal = document.getElementById(id); modal.style.display = "block"; span = modal.getElementsByClassName("close")[0]; } // When the user clicks on (x), close the modal function closeModal(id) { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } #footer-mobile button { background-color: #161616; } .modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.4); } .modal-header { padding: 2px 16px; background-color: #004494; } .modal-header h2 { color: white !important; } .modal-body {padding: 15px 16px;} .modal-content { position: relative; background-color: #fefefe; margin: 15% auto; padding: 0; border: 1px solid #888; width: 80%; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); animation-name: animatetop; animation-duration: 0.4s } @keyframes animatetop { from {top: -300px; opacity: 0} to {top: 0px; opacity: 1} }