0
I tried to use this form to "store" content (surrounded by blue in the print) that would be shown after clicking on the button that contains the image. But I can’t because the button doesn’t work (it doesn’t hide the content )
function myFunction(x) {
if (x.matches) {
$(document).ready(function () {
$("#abrirlast1").click(function () {
$("#urban1").toggle();
});
});
}
}
function myFunction(x) {
if (x.matches) {
$(document).ready(function () {
$("#abrirlast2").click(function () {
$("#urban2").toggle();
});
});
}
}
function myFunction(x) {
if (x.matches) {
$(document).ready(function () {
$("#abrirlast3").click(function () {
$("#urban3").toggle();
});
});
}
}
.last {
height: 100%;
padding: 10px;
text-align: center;
background-image: url(./imagens/blackfundo2_baixo.jpg);
}
.tituloimg1{
margin: 5px;
}
.videolast {
background: red;
width: 80vw;
height: 20vh;
margin-bottom: 10px;
}
.fecharlast {
float:right;
margin-bottom: 15px;
}
<div class="last">
<h3 class="titulolast">Histórias das vítimas</h3>
<button id="abrirlast1">
<img class="img1" src="./imagens/video_thumbnail.jpg" width="100%" height="100%">
</button>
<div id="urban1">
<h4 class="tituloimg1"> Nome da vitima </h4>
<div class="videolast"> </div>
<button class="fecharlast" id="fecharlastid"> Fechar </button>
</div>
<div id="urban2">
<button id="abrirlast2">
<img class="img1" src="./imagens/video_thumbnail.jpg" width="100%" height="100%">
</button>
<h4 class="tituloimg1"> Nome da vitima </h4>
<div class="videolast"> </div>
<button class="fecharlast" id="fecharlastid"> Fechar </button>
</div>
<div id="urban3">
<button id="abrirlast3">
<img class="img1" src="./imagens/video_thumbnail.jpg" width="100%" height="100%">
</button>
<h4 class="tituloimg1"> Nome da vitima </h4>
<div class="videolast"> </div>
<button class="fecharlast" id="fecharlastid"> Fechar </button>
</div>
</div>
myFunction
is created but never executed, where do you call it? 3) What kind of data isx
? What isx.matches
? 4) Why you have$(document).ready()
within theirif
? You know what it does?– fernandosavio