在spry中自动展开Accordion选项卡

时间:2011-06-14 11:16:24

标签: javascript spry

这是我的手风琴,当我的父配置展开时,如何自动展开“systemAccordion”

<div spry:region="mainData">
<div class="Accordion" id="mainAccordion" tabindex="0">
    <div class="AccordionPanel"><!-- <img align="left" src="/csm/include/images/healthicon.gif"> -->
        <div class="AccordionPanelTab"> <a onClick="showHealthCheckSpan();"><img align="left" src="/csm/include/images/healthicon.gif">Health Check</a></div>

    </div>
    <div class="AccordionPanel"><!-- <img align="left" src="/csm/include/images/conficon.gif"> -->
        <div class="AccordionPanelTab"> <a onClick="showSystemSpan();"><img align="left" src="/csm/include/images/conficon.gif">Configuration</a></div>
        <div class="AccordionPanelContent">

            <div class="Accordion" id="systemAccordion" tabindex="1">
                <div class="AccordionPanel">
                    <div class="AccordionPanelTab">    <a onClick="showSystemSpan();">System</a></div>
                    <div class="AccordionPanelContent">
                        <a onClick="showKernelParamSpan();">Kernel Parameters</a><br/>
                        <a onClick="showDiskSpan();">Disk Usage</a><br/>
                    </div>
                </div>
                <div class="AccordionPanel">
                    <div class="AccordionPanelTab">    {mainData::@product}</div>
                    <div class="AccordionPanelContent">
                        <span id='selectodbc'><a onClick="showOdbcSpan();">ODBC</a></span><br/>
                        <span id='selectbitmode'><a onClick="showBitmodeSpan();">Bitmode</a></span><br/>
                        <br/>
                    </div>
                </div>
                <script type="text/javascript">
                    var sysAcc = new Spry.Widget.Accordion("systemAccordion",  {defaultPanel: -1, useFixedPanelHeights: false });
                </script>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        var mainAcc = new Spry.Widget.Accordion("mainAccordion",{ defaultPanel: -1, useFixedPanelHeights: false });
    </script>
</div>

</div>

1 个答案:

答案 0 :(得分:0)

得到答案,当我们定义手风琴时,我们有如下选择

<script type="text/javascript">
    var sysAcc = new Spry.Widget.Accordion("systemAccordion",  {defaultPanel: 0, useFixedPanelHeights: false });
</script>

解决了我的问题。