I need to do an animation on a website i am creating.
I have 3 images and i need 2 of them to hide behind a main one (who is the one that has the mouse over it).
It must work with all the image containers.
I have tried to write a jQuery function to do it but i can't find the rest.
Extensive search didn't help althought i found pieces of the solution but i couldn't get them together.
Would appreciate a quick answer.
Here's my codepen with "part" of the solution: https://codepen.io/marcof/pen/GZYRoy - mouse over the left container and you will see the effect i pretend in the other ones. When i mouse over the middle one the left and right should hide behind it and so on.
$("#equipamentosdesportivos").hover(function(){
$("#caixa-equipamentosdesportivos").css('height','100%');
$("#descricao-equipamentosdesportivos").css('display','flex');
$("#caixa-equipamentosdesportivos div").addClass('informacao-posicao');
// animação posição
$("#parquesinfantis").animate({right: "80%"}, 600);
$("#mobiliariourbano").animate({right: "80%"}, 600);
},
function(){
$("#caixa-equipamentosdesportivos").css('height','15.5%');
$("#descricao-equipamentosdesportivos").css('display','none');
$("#caixa-equipamentosdesportivos div").removeClass('informacao-posicao');
}
); });
Too much code to post it here, please vist the codepen version.
HTML:
JS:
});