在循环内为accordion创建几个标题

时间:2017-02-07 08:00:06

标签: php jquery loops

我想为循环中的accordion创建几个标题。可以有不同数量的过程。

<script type="text/javascript">
$(function() {
    $(".Accordion").accordion({heightStyle:"content", collapsible:true});
});
<script>
<?php
for($y=0;$y<$len;$y++) {
    $result3 = getProcessNumber($projectNo, $holdprocess[$y]);
    if (!$result3) {
        die('Invalid query: ' . mysql_error());
    }
    while($row3 = mysqli_fetch_array($result3)) {
        $assigned =  $row3['assigned'] ;
    }
    ?>
    <div class='Accordion'>
        <h3>Process <?php echo $holdprocess[$y] ?> </h3>
        <div class='proc'>
            <div class='name'>Process: <?php echo $holdprocess[$y] ?>
                <div class='nmbr'>People required: <div class='numbr'><?php echo $holdnumber[$y] ?></div>
            </div>
        </div>
        <div class='assigned' name='assigned[]' >People Assigned:  <?php echo $assigned ?></div>
    </div>
</div>
<?php   
}
?>

但它只为最后一个进程创建头。 enter image description here

0 个答案:

没有答案