popup fiche id site pilotes
This commit is contained in:
+30
@@ -1656,6 +1656,36 @@ aside.layout-sidebar-second footer.view-footer p {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
#popup-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#popup-overlay img {
|
||||
max-width: 90%;
|
||||
max-height: 90%;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 20px #000;
|
||||
}
|
||||
|
||||
#popup-overlay .popup-close {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 30px;
|
||||
color: white;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*pages*/
|
||||
.home-page-layout-content {
|
||||
width: 100%;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const imageLinks = document.querySelectorAll(".file--image a");
|
||||
const popupOverlay = document.getElementById("popup-overlay");
|
||||
const popupImage = document.getElementById("popup-image");
|
||||
const closeBtn = document.querySelector("#popup-overlay .popup-close");
|
||||
|
||||
imageLinks.forEach(function(link) {
|
||||
link.addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
popupImage.src = this.href;
|
||||
popupOverlay.style.display = "flex";
|
||||
});
|
||||
});
|
||||
|
||||
closeBtn.addEventListener("click", function() {
|
||||
popupOverlay.style.display = "none";
|
||||
popupImage.src = "";
|
||||
});
|
||||
|
||||
popupOverlay.addEventListener("click", function(e) {
|
||||
if (e.target === popupOverlay) {
|
||||
popupOverlay.style.display = "none";
|
||||
popupImage.src = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user