Mudar url
Olá pessoal. O efeito lightbox abaixo está na pagina1.php e está funcionando normalmente. Quero que ao clicar na imagem o efeito lightbox aconteça e a url mude para pagina2.php . Resolvido , obrigado a todos !
<style>
body {
font-family: Verdana, sans-serif;
margin: 0;
}
.div_pai{
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(41, 37, 37, 0.9);
}
.close {
text-align: right;
float: right;
color: #FFF;
position: absolute;
top: 2px;
font-size: 50px;
font-weight: bold;
background: #d40000;
border: 1px solid #d40000;
}.close:hover,
.close:focus {
color: #FFF;
text-decoration: none;
cursor: pointer;
border: 1px solid #FFF;
}
.div_1 {
display: flex; flex-wrap: wrap;
background-color: #fefefe;
margin: auto;
max-width: 600px; width: 100%;
}
.img_1 {
margin: auto;
max-width: 600px; width: 100%;
border-radius: 8px;
transition-delay: 1s;
}
.mySlides {
max-width: 600px;
display: none;
}
.cursor {
cursor: pointer;
}
img {
margin-bottom: -4px;
}
img.hover-shadow {
transition: 0.3s;
}
.hover-shadow:hover {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
</style>
<h2 style="text-align:center">Lightbox</h2>
<img src="img1.png" style="width:200px" onclick="openModal()" class="hover-shadow cursor">
<div id="myModal" class="div_pai">
<div class="div_1">
<span class="close" onclick="closeModal()">×</span>
<img class="img_1" src="img2.jpg" style="width:100%" alt="Nature and sunrise">
</div>
</div>
<script>
function openModal() {
document.getElementById("myModal").style.display = "block";
}
function closeModal() {
document.getElementById("myModal").style.display = "none";
}
var slideIndex = 1;
showSlides(slideIndex);
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
}
</script>
**Resolvido , obrigado a todos !**Discussão (0)
Carregando comentários...