Javascript
$(document).ready(function() {
$(".container").animate({left:'120px'}, 6000).queue(function(next){
$(".child").css('display', 'none');
});
});
The provided code snippet demonstrates animating a single box and then hiding it upon completion. The challenge arises when attempting to apply the same animation to multiple identical boxes using the .each method, which has proven unsuccessful thus far. To reiterate, the goal is to sequentially animate each identical box in chronological order (starting with the top box in the HTML) and then hide the box using CSS. While this process works for a single box, it has been unsuccessful when attempting to animate multiple boxes simultaneously using .each.
HTML
<div class="container">
<div class="child"></div>
<div class="child"></div>
</div>