jquery animating dynamic height div
<p>quick question. im trying to animate a few things with jquery and although its working, this is the problem im having.</p>

<p>well first heres the code:</p>

<pre><code>$(document).ready( function(e){

// vars
var question = $('#faqQues');
var answer = $('#faqAns');  
var ansCont = $('#faqAnsCont');


question.click(function(){
    if(answer.css("display") != "none"){
        answer.animate({'height':0}, 500, hmm);
        function hmm(){
            answer.css("display","none");   
        } 

    } else {
        answer.css("display","block");
            answer.animate({"height":'100'},500);   

            }


});


});
</code></pre>

<p>essentially all i want to do be able to click something and it animate its height(up down).
the problem comes in on this code block</p>

<pre><code>else {
        answer.css("display","block");
            answer.animate({"height":'100'},500);   

            }
</code></pre>

<p>specifically on this line</p>

<pre><code>{"height":'100'}
</code></pre>

<p>what i want to happen is that it animates back to the divs default height. I dont want to
add a number <code>(like the 100 above)</code> height because the divs inner content is always going to change hence the dynamic height but if i remove the height, it breaks. Ive tried a few other things including something like maybe</p>

<pre><code>.animate({"height":'**divNameHere**.height()'},500);
</code></pre>

<p>but although it dont get errors, it doesnt work either lol.</p>

<p>So here i am asking for help. what changes do i need to make to this so that it animates back to whatever that divs height is without directly putting in a number?</p>

<p>Any Tips, code, links etc i'll gladly appreciate</p>
