[英]Problem while animating boxes using jQuery
在我的網頁上,我在右側有幾個框,一個框一個框,一個下面一個框。 每個框都有一個“ +”和“-”按鈕,可最大化/最小化指定的大小,類似於portlet中的大小。 但是,由於某種原因,它無法正常運行。 這是“-”按鈕的代碼:
<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; ?>
$( "#effect<?=$modules[$j]["title"]?>" ).animate({
top: <?=($top)?>,
}, "slow" );
<?php $count++; $top = (210*$count); ?>
<?php endfor; ?>
});
請幫忙!
使盒子變成盒子的全部是這樣的:
$( ".portlet-header" ).click(function() {
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
如此處所示: http : //jsfiddle.net/ndHK4/ 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.