1
Good guys, I have a div of id 'cont', this div 'cont' has 300px height and inside div 'cont' there are 3 other div of same class called 'box' where each div has 100px height, inside each div 'box' has another div of same class, where each after 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 came the first impasse, as everyone knows the Hover is activated by passing the mouse over, so thanks to the help of a member of the site here I implemented a JQUERY code, so the animation would come alive whenever the div 'box' was clicked. Now I want to improve this. I would like to animate all div dynamically. My goal is that when clicking on any div 'box' the div 'text' 'grow', however I also want to click on that same div 'box' the div 'text' return to its original size of 0px height, or if you click on another div 'box' the previously grown div 'text' goes back to its original size and the div 'text' for the currently clicked div 'box' grows.
the JQUERY code that I use to animate the box Divs is:
$(document).ready(function() {
$('.box', this).click(function(e){
$('.text').css('height', '100px');
});
});