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 7661273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:34:34+00:00 2026-05-31T13:34:34+00:00

I am using the jquery accordion for display information for a website. i make

  • 0

I am using the jquery accordion for display information for a website. i make the slider opens when the user clicks the specific link in the sub-menu like.

Facilities–> 1. Rooms
2. Hospitality
3. Green Walk
4. Book Options

If user click the any of the sub-menu the respected accordion tab will be open. with the below code i make it.

      <script type="text/javascript">
        jQuery(function () {
            jQuery("#accordion").accordion();
        });

        jQuery(document).ready(function () {
            $(<%=m_id %>).next().toggle('slow'); //<%=m_id%> the id of every tabs of accordion i pass form the code behind in asp.net

              });
        </script>

HTML:

                       <div id="accordion"> 

                        <h3 id="rooms">
                            a href="#">Rooms</a></h3>
                        <div id="rooms">
                            <p>
                                Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus

                            </p>
                        </div>
                        <h3 id="Hosp">
                            a href="#">Hospitality</a></h3>
                        <div id="Hosp">
                            <p>
                                High Performance team Building, Leadership
                                Development Program, Train the Trainers, Introduction to NLP and Advanced NLP, Fire-Walk
                                etc.
                            </p>

                        </div>
                        <h3 id="green">
                    Green Walk                            
                <div id="green">
                            <p>
                                et malesuada fames ac turpis egestas. Vestibulum
                                ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean
                                lacinia mauris vel est.
                            </p>

                        </div>
                        <h3 id="book">
                            <a href="#">Book Options</a></h3>
                        <div id="book">

                            <p>
                                Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class
                                aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

                            </p>
                        </div>
                    </div>

so, here the issue is when the user click the next sub-menu or click the next tab in the accordion the previous one is remains open.

How to close the opened tab when the next tab is open.

  • 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-31T13:34:36+00:00Added an answer on May 31, 2026 at 1:34 pm

    i got that accordion to work fine with this javascript

     <script type="text/javascript>
        var i=0;
            $(document).ready(function () {          
             jQuery('#accordion').accordion();
             autoHeight: true;
             $('#<%=m_id %>').next().slideDown('slow');
             $(document).click(function(){
             if(i==0){$('#<%=m_id %>').next().slideUp('slow');i++}else{$('#<%=m_id %>').val('');}
    
             });
            });
        </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jQuery accordion plugin to make an accordion of some data.
I am using jquery accordion effect when the clicks on a particular div the
I'm using a jQuery UI accordion as a menu on the right side of
I am using jquery for accordion menu, I have got a news box on
I'm using jQuery UI accordion() . I have 4 tabs. I want to make
I am using jQuery to produce an accordion effect in a menu I have
I am using JQuery Accordion and it works as it should and opens and
I am using jQuery Accordion here and find some strange behavior when opening a
http://mindfulintegrations.com/signiacapital/accordian.php I am using Jquery Accordion UI and if you look at the above
I'm working on a page using jQuery's accordion UI element . I modeled my

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.