Well, I have a 'cont' id div, this 'cont' div has a height of 300px, and within the 'cont' div there are 3 other divs of the same class called 'box' where each div has a height of 100px , inside each div 'box' has another div of the same class, where each one after being animated gains the height of 100px, here is the code:
<div id="cont">
<div class="box">
<div class="text">Texto Único 1</div>
</div>
<div class="box">
<div class="text">Texto Único 2</div>
</div>
<div class="box">
<div class="text">Texto Único 3</div>
</div>
</div>
Well, I used the css hover command to animate the divs 'box', which when passing the div 'text' grew and so showed its unique content, then the first impasse arose, as everyone knows the hover is activated by hovering the mouse, then thanks to the help of a member of the site I implemented a JQUERY code, so the animation would come alive whenever the 'box' div was clicked. Now I want to improve this. I'd like to animate all div dynamically. My goal is that when I click on any div 'box' the div 'text' 'grow', however I also want that when clicking on that same div 'box' the div 'text' returns to its original size of 0px height, or if you click on another div 'box' the div 'text' that has grown previously will return to its original size and the div 'text' for the currently clicked 'div' box will grow.
The JQUERY code I use to animate the divs 'box' is:
$(document).ready(function() {
$('.box', this).click(function(e){
$('.text').css('height', '100px');
});
});