Problem while animating boxes using jQuery
<p>On my webpage, I have a few boxes one below the other, on the right side. Each box has a '+' and '-' button which maximizes/minimizes to the specified size, similar to that in portlets. But, for some reason, it is not working as it is suppose to. 
Here is the code for '-' button:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(function() {
    &lt;?php for($i=0;$i&lt;count($modules);$i++) : ?&gt;        
    $( "#minusbtn&lt;?=$modules[$i]["title"]?&gt;").click(
    function() {
        $( "#effect&lt;?=$modules[$i]  ["title"]?&gt;").animate({                 
height: 35,
}, "slow" );
    &lt;?php $count=0; $top=0; ?&gt;  
    &lt;?php for($j=$i;$j&lt;count($modules);$j++): ?&gt;
    &lt;?php if($i==$j) continue; ?&gt;
        $( "#effect&lt;?=$modules[$j]["title"]?&gt;" ).animate({
        top: &lt;?=($top)?&gt;,
        }, "slow" );
    &lt;?php $count++; $top = (210*$count); ?&gt; 
    &lt;?php endfor; ?&gt;
    });
</code></pre>

<p>Please help!</p>
