Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6662367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:22:55+00:00 2026-05-26T02:22:55+00:00

I have a Jquery accordion which works fine. Sections get expanded/collapsed when clicked on

  • 0

I have a Jquery accordion which works fine. Sections get expanded/collapsed when clicked on respective headers. But I want to add the functionality so that when I click on “next” button it opens up the next section and clicking “Previous” button takes me back to previous section.

This has been done on this page http://jquery.bassistance.de/accordion/demo/?p=1.1.2 (last example) but not sure how do I implement the same in my case.

Any suggestions please.

Thanks

UPDATE: How do I get previous or next section of the accordion?

<script type="text/javascript">
 $("#accordion").accordion({ 
   header: "h3.header"
   , autoHeight: false
   , collapsible: true
  });
</script>

<div id="accordion">
 <h3 class="header">Section 1</h3>
 <div> content 1 .. content 1 .. content 1 .. content 1 ..
  <input class="next" type="button" value="next"/>   
 </div>
 <h3 class="header">Section 2</h3>
 <div> content 2 .. content 2 .. content 2 .. content 2 ..
  <input class="previous" type="button" value="previous"/>
  <input class="next" type="button" value="next"/>   
 </div>
 <h3 class="header">Section 3</h3>
 <div> content 3 .. content 3 .. content 3 .. content 3 ..
  <input class="previous" type="button" value="previous"/>
 </div> 
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:22:56+00:00Added an answer on May 26, 2026 at 2:22 am

    I was able to get it to work. Give this a shot, it works with jQuery 1.6 and jQuery UI 1.8:

    HTML:

    <div id="checkout">
        <h2><a href="#">Section 1</a></h2>
        <div>
            <form action="#">
                <h3>Content</h3>
                <input type="submit" class="next" value="Continue" />
            </form>
        </div>
        <h2><a href="#">Section 2</a></h2>
        <div>
            <form action="#">
                <h3>Content</h3>
                <input type="submit" class="prev" value="Back" />
            </form>
        </div>
    </div>
    

    jQuery:

    <script type="text/javascript">
        $(document).ready(function () {
            // create new accordion
            var checkout = $('#checkout').accordion({ event: false });
    
            // assign accordion navigation events to button clicks
            $('form', checkout).each(function (index) {
                $(this)
                .children(':submit')
                .filter('.next, .prev')
                .click(function () {
                    checkout.accordion('option', 'active', index + ($(this).is('.next') ? 1 : -1));
                    return false;
                });
            });
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have done an Accordion style jQuery function which works lovely, but would like
I have a jquery-ui accordion widget listing project parts which works fine (they are
I have jquery validation code which is working fine in ff but the same
I have a jquery accordion which I want to add rows to. I can
I have a jQuery accordion from this site and edited for my purposes, but
I have a jQuery accordion in a page in ASP:Net MVC application in which
I'm trying to get a jQuery UI Accordion, with initially all divs collapsed. The
I am working with jQuery UI Accordion and it works great, but I would
I'm using jQuery UI accordion() . I have 4 tabs. I want to make
I have a Jquery Accordion and I have a asp.net GridView below that. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.