Popup con imagen
/* Estilos para el popup */
.popup {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
}
.popup img {
display: block;
margin: 10% auto;
max-width: 80%;
max-height: 80%;
}
Ejemplo de Popup con Imagen
Haz clic en la imagen para visitar la página web:
// Función para mostrar el popup
function showPopup(url) {
document.getElementById(‘popup’).style.display = ‘block’;
setTimeout(function() {
window.location.href = url;
}, 3000); // Configura el tiempo de permanencia en milisegundos (3000 = 3 segundos)
}
