我创造了一个手风琴,它有两个问题:
我已经描述了here,但它没有用。
HTML代码如下所示:
<div id="AddInfo" >
<h3><a href="#">You have ordered...</a></h3>
<div id="summary" class="accordion">
<p>Your basket is currently empty.</p>
</div>
<h3><a href="#">Payment Details</a></h3>
<div id="payment" class="accordion" index="1">
<form id="form1" name="form1" method="post" action="">
<table>
<tr>
<td><label for"Name">Name on Card</label></td><td><input type="text" /></td>
<tr>
<td><label for"ccNo">Credit/Debit Card No</label></td>
<td><input type="text" id="ccNo"/>
</tr>
<tr id="exp">
<td><label for"Exp">Expiry Date</label></td>
<td><label for "expMonth">Month</label><input type="text" id="expMonth"/>
<label for "expYear">Year</label><input type="text" id="expYear"/></td>
</tr>
<tr>
<td><label for"Type">Card Type</label></td>
<td><select class="cardType">
<option value="Visa">Visa</option>
<option value="Mastercard">Mastercard</option>
<option value="American Express">American Express</option>
</select></td>
<tr id="secCode">
<td><label for"secCode">Security Code:</label></td><td><input type="text" id="secCode"/></td>
</table>
</form>
</div>
<h3 ><a href="#">Delivery Details</a></h3>
<div id="delivery" class="accordion">
<form id="delivForm">
<table>
<tr class="Name">
<td><label for"delName">Name:</label></td><td><input type="text" id="delName"/></td>
</tr>
<tr class="Address">
<td><label for"delName">Address:</label></td><td><input type="text" id="Add1"/></td>
</tr>
<tr class="Address">
<td></td><td><input type="text" id="Add2"/></td>
</tr>
<tr class="Address">
<td></td><td><input type="text" id="Add3"/></td>
</tr>
<tr class="Address">
<td></td><td><input type="text" id="Add4"/></td>
</tr>
<tr class="pCode">
<td><label for "pCode">Postcode:</label></td><td><input type="text" id="pCode"/></td>
</tr>
</tr>
</table>
<div>
jQuery脚本如下所示:
<script>
$(function() {
$( "#AddInfo" ).accordion()
});
</script>
有什么建议吗?
提前致谢!
答案 0 :(得分:1)
包括active
和collapisble
选项,如下所示(updated demo):
$("#accordion").accordion({
collapsible: true,
active: false,
header: "h3"
});
说实话,回答并接受你自己的答案是不好的形式,然后再问一遍,因为它没有真正起作用。