我对JQuery并不了解。我正在使用JQuery手风琴显示记录。我正在使用一个主要的手风琴,并且希望在其中显示多个手风琴。
主手风琴只在下面显示一行,而所有相关的行都在外面显示。主要的手风琴 [复数?] 也是动态的。
下面是我的代码
<?php
$accordionCounter = 1;
$outerAccordianCounter = 1;
if ($unassignedFaxesByDate) :
foreach ($faxSourceType as $id => $faxSourceTypeName): ?>
<div class="accordionSection" id="outeraccordion_<?php echo $outerAccordianCounter; ?>">
<?php if(sizeof($unassignedFaxesByDate[$faxSourceTypeName]) > 0) : ?>
<h4>
<u>
<?php echo $faxSourceTypeName." faxes "; ?>
</u>
</h4>
<?php foreach ($unassignedFaxesByDate[$faxSourceTypeName] as $faxTypeId => $faxType):
foreach ($faxType as $date => $unassignedFaxDates):
foreach ($unassignedFaxDates as $resource => $unassignedFaxDate ): ?>
<div class="accordionSection" id="accordion_<?php echo $accordionCounter; ?>">
<h3>Some Name</h3>
<div>
<script type="text/javascript">
$(function()
{
$("#tablesorter_<?php echo $date; ?>_<?php echo $faxTypeId; ?>_<?php echo $resource ?>_<?php echo $faxSourceTypeName;?>").tablesorter({
sortList:[[6,1]],
showProcessing: true,
theme : 'blue',
widgets: ["zebra", "filter", 'indexFirstColumn'],
widgetOptions : { filter_reset : '.reset' }
});
$("#accordion_<?php echo $accordionCounter; ?>").accordion({
collapsible: true,
active: false,
heightStyle: "content",
});
$( "#outeraccordion_<?php echo $outerAccordianCounter; ?>" ).accordion({
collapsible: true,
active: false,
heightStyle: "content",
});
});
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="3" class="tablesorter" id="tablesorter_<?php echo $date; ?>_<?php echo $faxTypeId; ?>_<?php echo $resource?>_<?php echo $faxSourceTypeName;?>">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Workflow Source</th>
</tr>
</thead>
<tbody>
<?php foreach ($unassignedFaxDate as $unassignedFax) : ?>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<?php
$accordionCounter++;
?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php $outerAccordianCounter++; ?>
<?php endforeach; ?>
<?php endif; ?>