I want to show 3 images in order and the action does not end.
I guess I need a loop but I do not clarify with the loops.
The intention is to make these actions in JS not have an end, that is, when returning to position the mouse on the image punt2
will show everything again. I think the solution would be to add a parameter to the two functions but I do not know how to perform this action.
function pasaConHover() {
document.getElementById('punt0').style.display = "none";
document.getElementById('punt1').style.display = "block";
}
function pasaConHover1() {
document.getElementById('punt2').style.display = "block";
document.getElementById('punt0').style.display = "none";
document.getElementById('punt1').style.display = "none";
}
/*//Aquí consigo CASI lo que pretendía pero me muestra la imágen punt1 en vez de la punt0*/
function dVuelta () {
document.getElementById('punt2').style.display="none";
document.getElementById('punt0').style.display="block";
document.getElementById('punt1').style.display="none";
}
<div class="semantica">
<a target="_blank" href="#">
<div class="montar">
<img id="punt0" onmouseover="pasaConHover();" src="http://placehold.it/100?text=punt0" alt="imágen/enlace 0">
<img id="punt1" onmouseout="pasaConHover1();" src="http://placehold.it/100?text=punt1" alt="imágen/enlace 1">
<img onmouseover="dVuelta();" id="punt2" src="http://placehold.it/100?text=punt2" alt="imágen/enlace 2">
</div>
</a>
</div>