-1

我无法选中/取消选中 Accordion 小部件内的单选按钮。

这是我的代码:

<SCRIPT LANGUAGE="JavaScript">
    $(function() {
        $( "#accordion" ).accordion();
    });   
</SCRIPT> 

<div id="accordion" >
    <input type="radio" id="worddoc"  name="submissionType">Upload Word
    <div>
        <input type="file"/>
    </div>
    <input type="radio" id="pdfdoc" name="submissionType">Upload Pdf
    <div>
        <input type="file"/>             
    </div>
</div>
4

2 回答 2

0

您只需要为每个手风琴选项添加标题,如下所示:

<div id="accordion" >
    <h1>Option 1</h1>
    <div>
        <input type="radio" id="worddoc"  name="submissionType" /> Upload Word
        <input type="file"/>
    </div>
    <h1>Option 2</h1>
    <div>
        <input type="radio" id="pdfdoc" name="submissionType" />Upload Pdf
        <input type="file"/>             
    </div>
</div>

<script>
    $(function() {
        $("#accordion").accordion();
    });
</script>

请参阅此JSFiddle。如果这不是你的意思,请告诉我。

于 2013-11-16T20:02:43.263 回答
0

检查这个

<SCRIPT LANGUAGE="JavaScript">
            $(function() {
                $( "#accordion" ).accordion();
            });   
  </SCRIPT> 

<div id="accordion" >
    <div>
        <input type="radio" id="worddoc"  name="submissionType"> Upload Word
        <input type="file"/>
    </div>
    <div>
        <input type="radio" id="pdfdoc" name="submissionType">Upload Pdf
        <input type="file"/>             
    </div>
</div>
于 2013-11-04T12:08:28.390 回答