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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:33:30+00:00 2026-06-18T03:33:30+00:00

I am working with 3 buttons and 3 sections in my page. Here’s the

  • 0

I am working with 3 buttons and 3 sections in my page. Here’s the stripped down code.

http://jsfiddle.net/f6P87/17/

when loading the page:
FilterBtn is shown,
ResultsBtn is hidden,
DetailsBtn are shown.
Filters div is hidden,
Results div is shown,
Details div is hidden.

If the user clicks detailsBtn:
filterBtn is hidden,
ResultsBtn is shown,
ResultsSection div (including results div and filters div) is hidden,
Details div is shown.

If the user clicks resultsBtn:
filterBtn is shown,
resultsBtn is hidden,
results div is shown,
filters div is hidden,
details div is hidden.

If the user clicks filterBtn:
filterBtn is hidden,
resultsBtn is shown,
results div is hidden,
filters div is shown,
details div is hiden.

This isn’t currently working the way I want. When I click a button both divs are hidden no matter how i arrange them in the script. Can someone help me with the script logic to make this work?

Here is the HTML:

<div id="wrap">
    <div class="row">
        <div id="filterBtn"> <a href="#" class="button">Filters Button</a> 
        </div>
        <div id="resultsBtn"> <a href="#" class=" button">Results Button</a> 
        </div>
    </div>
    <div id="resultsSection" class="row" style="display:block;">
        <div id="filters">Filters Section</div>
        <div id="results">Results Section
            <div class="hide-for-small detailsBtn"> <a href="#" class=" button">Details Button</a> 
            </div>
        </div>
        <!-- Details -->
        <div id="detailSection" class="row details" style="padding-top:0px" ;>
            <div class="row">
                 <h3><small>Details Section</small></h3>

            </div>
        </div>

And Script:

$("#resultsBtn").click(function () {
    $("#detailSection").show("slow");
    $("#resultsSection").toggle("slow");
    $("#resultsBtn").hide("fast");
});

$(".detailsBtn").click(function () {
    $("#detailSection").show("slow");
    $("#resultsSection").hide("slow");
    $("#resultsBtn").show("fast");
      $("#filtersBtn").hide("fast");
});

$("#filterBtn").click(function () {
    $("#resultsBtn").show("fast");
    $("#filterBtn").hide("fast");
    $("#filters").show("slow");
    $("#resultsSection").hide("slow");    
});
  • 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-18T03:33:31+00:00Added an answer on June 18, 2026 at 3:33 am

    Going by your HTML the reason everything hides is because you are telling it to hide the result section, which wraps around everything.

    $("#filterBtn").click(function () {
        $("#resultsBtn").show("fast");
        $("#filterBtn").hide("fast");
        $("#filters").show("slow");
    
        // This hides the whole section which is wrapping around everything
        $("#resultsSection").hide("slow");    
    });
    

    I think you have to go through your expectations again and make sure you target the correct elements. Once working you can optimize the methods. I try to sort it out but it will take a little bit.

    You had nearly all right except, some 1 or 2 </div> were missing and had to be added, the last line in the filter button event should have been referring to the #results element instead of the #resultsSection and in a few places you had the element id for the filter buttons misspelled. You wrote #filtersBtn instead of #filterBtn.

    Anyway, the below should match your expectations now. the hide/shows are orderd now in the same order you listed them in your expectations.

    —

    DEMO – New Code

    —

    $("#resultsBtn").click(function () {
        $("#resultsSection").show("slow");
        $("#filterBtn").show("fast");
        $("#resultsBtn").hide("fast");
        $("#results").show("slow");
        $("#filters").hide("slow");
        $("#detailSection").hide("slow");
    });
    
    $(".detailsBtn").click(function () {
        $("#filterBtn").hide("fast");
        $("#resultsBtn").show("fast");
        $("#resultsSection").hide("slow");
        $("#detailSection").show("slow");
    });
    
    $("#filterBtn").click(function () {
        $("#filterBtn").hide("fast");
        $("#resultsBtn").show("fast");
        $("#results").hide("slow");
        $("#filters").show("slow");
        $("#detailSection").show("slow");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my working page . I attached buttons to white bishop and you
I'm trying to run the following code, written on my local machine: http://www.jsfiddle.net/WShdx/3/ Functionality-wise
I can't figure out why the next page/previous page buttons stop working after a
Here's the page in question: http://www.lukaspleva.com/MoneyThink/NationalAdmin.php If you go to that page, you'll see
I've seen several questions asked about simple <input type=submit /> buttons not working in
I am working on changing the buttons on my site to be styled by
I'm working on an application that contains some buttons defined via layout.xml like this
Hi I am working on an application which creates dynamic components like buttons etc.
I'm working on a PyGTK app with some Buttons that, when clicked, give a
I am working on project where I want to show UIActionsheet with three buttons

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.