I use the `.done` method to generate an order between related functions that must be executed one after the other. I usually have the ".done is not a function" error, due to the fact that its not very clear for me where can `.done` be placed.

In this case I have the same problem: I need first that `.newClassForm` animates till 0 height, and then `.infoText` to be filled with some text and be displayed, in this order.

If I use the `.done` method as it shows here, the mentiones error occurs. 

**Where can `.done` be placed? How could I solve cases like this?:**

```
$('.tableClassHeader').on('click', '.smartFormDiscard', function(){                     
    $('.newClassForm').animate({'height': 0}, 500);}).done(function(){
            $('.infoText').text("Crea una nueva clase").css('display','inline');
    })

```