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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:07:16+00:00 2026-06-17T10:07:16+00:00

I have a confusing problem with plain jQuery . I need to make the

  • 0

I have a confusing problem with plain jQuery . I need to make the first div detailsPane stay open always no matter when the header details is clicked or not. In other words wheat ever headers of whichever div is clicked, the div detailsPane should stay open ALWAYS. But I want the rest to be able to click open and close kinda like toggle.

The HTML is below

            <div class="petStockAccordion">
            <div id="accordion">
            <!-- DETAILS -->
              <h2 class="current">
                <a href="#tab-details" class="tab_01">
                    details
                </a>
              </h2>
              <div class="pane detailsPane" style="display:block">
                    DIV 1
              </div>
            <!-- Ingredients -->    
              <h2>
                <a href="#tab-reviews" class="tab_02">
                    ingredients
                </a>
              </h2>
              <div class="pane">
                This needs further work.
              </div>
            <!-- Delivery -->   
              <h2>
                <a href="#tab-deliveryTab" class="tab_03">
                    delivery

                </a>
              </h2>
              <div class="pane">
                    Div3
              </div>
            <!-- Reviews -->    
              <h2>
                <a href="#tab-reviews" class="tab_04">
                    reviews

                </a>
              </h2>
              <div class="pane">
                DIV4

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

And the jquery part is below

            <script type="text/javascript">
            function initMenu() {
              $('.petStockAccordion #accordion .pane').hide();
              $('.petStockAccordion #accordion .detailsPane').show();
              $('#accordion h2 a').click(
                function() {         $(this).parent('h2').next('div').slideToggle('fast');    
                  }
                );
              }
            $(document).ready(function() {initMenu();}); 
            </script>
  • 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-06-17T10:07:17+00:00Added an answer on June 17, 2026 at 10:07 am

    Do this, using “not” method. this will keep the “detailsPane” div open if you click the first anchor or not.

    <script type="text/javascript">
    function initMenu(){
        $('.petStockAccordion #accordion .pane').not('.detailsPane').hide();
        $('#accordion h2 a').click(function() {                          
              $(this).parent('h2').next('div.pane').not('.detailsPane').slideToggle('fast');    
         });
        $(document).ready(function(){ initMenu(); });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am finding it bit confusing working around this problem. I have parent DIV
I'm having a really confusing problem. I have a UIWebView that is contained within
I have a setup, something confusing like this: <ListView> <ItemTemplate> <div id=Content> <asp: TextBox
This might get a little confusing as I have tried everything to make this
I have a confusing problem in my code, in which one object gets initialized
I have a relatively confusing problem: I created several empty Xcode projects and ran
I am having a very confusing problem with an application I have been working
I have this problem of confusing when to include the entire object as a
Hi I have a confusing problem with the Autoscroll implementation in my own app.
I have a rather confusing problem. I have a php file (http://example.com/delete.php) <?php session_start();

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.