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

  • Home
  • SEARCH
  • 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 8838209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:55:58+00:00 2026-06-14T09:55:58+00:00

I have multiple buttons on one page. WHen you click a button, a panel

  • 0

I have multiple buttons on one page. WHen you click a button, a panel slides out and reveals content. I set up a working demo here: http://jsfiddle.net/5ZgMR/1/

As you can see, it works fairly well. When a button is clicked, a panel shows, and then when it is clicked again, the panel slides down. The problem lies when you open one panel and then a second. It is buggy in that the active class stays and the panel doesn’t react on the next click. It is best if you just try the demo and see for yourself. Click a few times, as the bug doesnt happen on the first click.

I think the problem lies within the callback function in the toggle, as shown below. Anyone have any ideas how to fix this issue?

$("a.button").toggle(function(){
         idClick = $(this).attr("id");
         newSelector = $("#pane"+idClick);
         varthis = $(this);

         newSelector.animate({ 'bottom' : 99});
         $(".pane").not(newSelector).animate({ 'bottom' : -275});
         $(this).addClass("activeBtn");
         $("a.button").not(varthis).removeClass("activeBtn");

    }, function(){
        newSelector.animate({ 'bottom' : -275});
        $(this).removeClass("activeBtn");
    });​
  • 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-14T09:55:59+00:00Added an answer on June 14, 2026 at 9:55 am

    I think the toggle is going to mess you up because a given pane could’ve been hidden either from clicking on the corresponding button OR by clicking a different button. Try something more like this….

    $("a.button").click(function(e){
         idClick = $(this).attr("id");
         var newSelector = $("#pane"+idClick);
         varthis = $(this);
    
         if ($(this).hasClass("activeBtn")){
             $(this).removeClass("activeBtn");
             newSelector.animate({ 'bottom' : -275});
         }
         else{
             newSelector.animate({ 'bottom' : 99});
             $(".pane").not(newSelector).animate({ 'bottom' : -275});
             $("a.button").removeClass("activeBtn");
             $(this).addClass("activeBtn");
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an aspx page with multiple FileUpload controls and one Upload button. In
I have multiple buttons on a page and I want to simulate a click
I have multiple twitter share buttons on a page, I want to identify which
In my WP 7.1 app I have a page with multiple buttons. I noticed
Multiple sites have buttons where you can tweet, digg, etc. On this page you'll
I have multiple pages branching of a title page, and when a back button
I have copied the controls and decorations from one content page to another, as
I have multiple audio players, each with a play and stop button, on one
I have a form on an HTML page with multiple submit buttons that perform
So I have a page, it had multiple textboxes, linkbuttons, and buttons. Currently, a

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.