How do I write the following code as a for loop?
<p>Firstly,
     Is there a way for me to put variable declarations in a for loop?</p>

<p>E.g. the following:</p>

<pre><code>var origh1 = $('#candidates img:eq(0)').height();  
var origh2 = $('#candidates img:eq(1)').height();
var origh3 = $('#candidates img:eq(2)').height();
var origh4 = $('#candidates img:eq(3)').height();
var thumb1h = $('#candidates img:eq(0)').height()*0.20; 
var thumb2h = $('#candidates img:eq(1)').height()*0.20;
var thumb3h = $('#candidates img:eq(2)').height()*0.20;
var thumb4h = $('#candidates img:eq(3)').height()*0.20;
</code></pre>

<p>Then using that those variables, I would like the following in a for loop. Naturally, 'origh1' should equal img:eq(i), where i = 0. So I imagine if origh1 were in the loop, it would be something like origh(i+1). </p>

<pre><code>$('#candidates img:eq(0)').fadeIn('normal').delay(300).animate({ height : origh1}, 1200, 'easeInQuad');
$('#candidates img:eq(1)').fadeIn('normal').delay(300).animate({ height : origh2}, 1200, 'easeInQuad');
$('#candidates img:eq(2)').fadeIn('normal').delay(300).animate({ height : origh3}, 1200, 'easeInQuad');
$('#candidates img:eq(3)').fadeIn('normal').delay(300).animate({ height : origh4}, 1200, 'easeInQuad');
</code></pre>

<p>Thanks :)</p>
