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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:07:23+00:00 2026-06-11T23:07:23+00:00

Im creating a NAVIGATION, it has 3 states. Normal, Rollover and Selected. And each

  • 0

Im creating a NAVIGATION, it has 3 states. Normal, Rollover and Selected.

And each button has different images for all 3 states.
naviation

I want to do this with jQuery.

State 1 & 2 I can show with seperate class for

.boy1 a {background-image:...}
.boy1 a:hover {background-image:...}
.boy2 a {background-image:...}
.boy2 a:hover {background-image:...}
.boy3 a {background-image:...}
.boy3 a:hover {background-image:...}

But when you click on BUTTON, it should show a DIV that contains its NAME or any other image.

e.g.

$(".boy1").click(function() {
  $("#boy1").show("slow");
});

But now my problem is, if someone clicks on other buttons earlier #boy1 DIV should hide and if you click .boy2 then #boy2 show show and other #boy1 or #boy3 should hide

HTML PART:

<div id="navigation">
    <div class="boy1"><a href="#section1"></a></div>
    <div id="boy1">MR ABC</div>

    <div class="boy2"><a href="#section2"></a></div>
    <div id="boy2">MR XYZ</div>

    <div class="boy3"><a href="#section3"></a></div>
    <div id="boy3">MR LALOLA</div>
</div>

<style type="text/css">
    .boy1 a { background-image:images/boy1.gif; display:block; cursor:pointer; height:100px; width:50px}
    .boy1 a:hover { background-image:images/boyimage1.gif;}
    #boy1 {position:absolute; top:100; left:50; height:30px; width:60px;}

    .boy2 a { background-image:images/boy2.gif; display:block; cursor:pointer; height:100px; width:50px}
    .boy2 a:hover { background-image:images/boyimage2.gif;}
    #boy2 {position:absolute; top:100; left:200; height:30px; width:60px;}

    .boy3 a { background-image:images/boy3.gif; display:block; cursor:pointer; height:100px; width:50px}
    .boy3 a:hover { background-image:images/boyimage3.gif;}
    #boy3 {position:absolute; top:100; left:350; height:30px; width:60px;}
</style>
  • 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-11T23:07:25+00:00Added an answer on June 11, 2026 at 11:07 pm

    HTML

    <div id="navigation">
        <div class="boy1"><a href="#section1">x</a></div>
        <div id="boy1" class="showhidediv">MR ABC</div>
    
        <div class="boy2"><a href="#section2">y</a></div>
        <div id="boy2" class="showhidediv">MR XYZ</div>
    
        <div class="boy3"><a href="#section3">z</a></div>
        <div id="boy3" class="showhidediv">MR LALOLA</div>
    </div>​
    

    JS

    $(document).ready(function() {
    
      $('div.boy1').on('click',function(){
        $('div#boy1').siblings('.showhidediv').hide();
        $('div#boy1').show();
    });
    
      $('div.boy2').on('click',function(){
        $('div#boy2').siblings('.showhidediv').hide();
        $('div#boy2').show();
    });
    
       $('div.boy3').on('click',function(){
        $('div#boy3').siblings('.showhidediv').hide();
        $('div#boy3').show();
    });
    
    });
    

    ​check the demo here

    add $('.showhidediv').hide(); to your code if you want to start by hiding all the divs.

    I hope this will solve your problem. If you have any questions please don’t hesitate to ask. Thanks

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

Sidebar

Related Questions

I am creating a website that has 5 different sub-sites each with the same
Im creating a navigation window with tabs round cornered. im trying to do this
I am creating a simple iPhone navigation based application. In this I am moving
Has anyone had any success creating an info button (italic 'i' in a circle)
I want to make a back button for a navigation controller with the title
I am creating a reference app which has a navigation bar at the top
Im creating a line object which is an entity it has a Tags navigation
I'm creating a site that has a series of four images on the homepage
I am bit stack with creating two UIViews which are switchable (each UIView has
I have this form Im creating and when you click on the Next button

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.