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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:13:27+00:00 2026-06-09T21:13:27+00:00

I have a image with 2 buttons: <div class=panel> <div> <a class=a-button>Toggle A</a> <a

  • 0

I have a image with 2 buttons:

<div class="panel">
    <div>
        <a class="a-button>Toggle A</a>
        <a class="b-button>Toggle B</a>
    </div>
    <p id="statics">Statics numbers</p>
   <p id='chart">Chart</p>
</div>
<div class="item-img"><img src="..."></div>

If I want to view #statics, I click a-button to hide item-img. Then, click again to show img and hide #statics.

If I want to view #chart, I click b-button to hide item-img, then, click again to show item-img and hide #chart.

jQuery(document).ready( function($) {
    $(".a-button").click(function () {
        $("#statics").toggle("slow");
        $(".item-img").toggle('slow');
        });
    $(".b-button").click(function () {
        $("#chart").toggle("slow");
        $(".item-img").toggle('slow');
        });
});

The problem is– If I hide item-img by either toggler a-button or b-button, Then, click the other toggler(a or b) before click the first toggler to show the item -img again, Both #statics and #chart show up, make a big mess.

How can I disable one toggler when another toggler is not toggle back yet?

  • 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-09T21:13:29+00:00Added an answer on June 9, 2026 at 9:13 pm
    jQuery(document).ready( function($) {
        $(".a-button").click(function () {
            if(!$("#chart").is(':visible')) {
                $("#statics").toggle("slow");
                $(".item-img").toggle('slow');
            }
            });
        $(".b-button").click(function () {
            if(!$("#statics").is(':visible')) {
                $("#chart").toggle("slow");
                $(".item-img").toggle('slow');
            }
            });
    });
    

    Working Fiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have placed an Image as a button in my App and I want
I have an img tag (id image). The src of the img is assigned
I have a MasterPage that has two image buttons , and two content pages,
I have 2 tables, where I have some rows with some image buttons. What
I have some 10 buttons with image-text and hover states for each. What I
I have to buttons, image input that work fine when in the markup like
I have a image button thats acts as a form submit button: <a href=#
I have a problem that when I click on the image button instead of
I have given bg image for radio button. It is working in chrome but

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.