views:

37

answers:

1

i'm tring to focus a textarea after a animate effect with:

$("#textarea").live("click",function(){
        if ($(this).attr("class") != "textarea_clicked") {
            $(this).val("");            
            $(this).animate({
                height: "+=30"
            }, 150, function(){
                $(this).attr("class", "textarea_clicked");
                $(this).elastic();
                $(this).focus();                
            });

        }
    })

But it doesn't work.

How can i do that?

thanks

A: 

Try this:

$("#textarea").live("click",function(){
        if ($(this).attr("class") != "textarea_clicked") {
            $(this).val("");            
            $(this).animate({
                height: "+=30"
            }, 150, function(){
                $(this).attr("class", "textarea_clicked");
                $(this).elastic();
            });

            $(this).focus();
        }
    })
Sarfraz