English 中文(简体)
利用投入但纽 约
原标题:Open jQuery Accordion using input button

I have created an accordion and there are two issues with it:

  1. I want all sections to be closed on pageLoad
  2. I want to be able for the first section to open on click of an input button (which is already running another function).

我已经描述了here,但做了一些工作。

超文本代码如下:

<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>

The jQuery script look as this:

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

任何建议?

提前感谢!

问题回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签