Ich kann diese ziemlich einfache Frage nicht posten, ohne etwas Text hinzuzufügen, also ignorieren Sie bitte Folgendes ... Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Code: Select all
[img]image.jpeg[/img]
×
[img]image.jpeg[/img]
Code: Select all
var modal = document.getElementById("Modal");
var btn = document.getElementById("btn");
var span = document.getElementsByClassName("close")[0];
const closeButton = document.getElementById('closeButton');
btn.onclick = function() {
modal.style.display = "block";
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
Code: Select all
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
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-content {
background-color: #fff5ee;
margin: auto;
padding: 20px;
border: 1px solid #c7effb;
width: 80%;
}
.close {
color: #b385dc;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: blueviolet;
text-decoration: none;
cursor: pointer;
}
Mobile version