开发者

Problem while animating boxes using jQuery

开发者 https://www.devze.com 2023-03-25 13:22 出处:网络
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 s

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:

<script type="text/javascript">
$(function() {
    <?php for($i=0;$i<count($modules);$i++) : ?>        
    $( "#minusbtn<?=$modules[$i]["title"]?>").click(
    function() {
        $( "#effect<?=$modules[$i]  ["title"]?>").animate({                 
height: 35,
}, "slow" );
    <?php $count=0; $top=0; ?>  
    <?php for($j=$i;$j<count($modules);$j++): ?>
    <?php if($i==$j) continue; ?>开发者_如何学C;
        $( "#effect<?=$modules[$j]["title"]?>" ).animate({
        top: <?=($top)?>,
        }, "slow" );
    <?php $count++; $top = (210*$count); ?> 
    <?php endfor; ?>
    });

Please help!


All it is that makes the boxes is this:

$( ".portlet-header" ).click(function() {
    $( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});

As seen here: http://jsfiddle.net/ndHK4/.

0

精彩评论

暂无评论...
验证码 换一张
取 消