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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:32:47+00:00 2026-06-06T04:32:47+00:00

Let me begin by saying I realize this isn’t the best idea from an

  • 0

Let me begin by saying I realize this isn’t the best idea from an accessibility standpoint, but the functionality is not up to me to decide 🙂

I would like there to be one “content box” visible at a time (there are three total) – and which box is currently displayed will be decided by which corresponding link is being hovered over (and box-one will display on page load before any hover actions).

If we imagine I have the following HTML:

<ul>
    <li id="link-one">Link One</li>
    <li id="link-two">Link Two</li>
    <li id="link-three">Link Three</li>
</ul>

<div id="box-one">Content for box one.</div>
<div id="box-two">Content for box two.</div>
<div id="box-three">Content for box three.</div>

I would like #box-one to display by default. Then if the #link-two or #link-three are hovered over, then #box-two or #box-three would display accordingly.

It would be excellent if there was a fade animation during the transfer.

This is line of thinking I’m approaching this with – I realize this isn’t valid jQuery syntax, but if anyone can help me turn this into something real I would greatly appreciate it!

if ($(#link-one).mouseenter(function() {
    $(#box-one).show();
    $(#box-two).hide();
    $(#box-three).hide();
});)

if ($(#link-two).mouseenter(function() {
    $(#box-two).show();
    $(#box-one).hide();
    $(#box-three).hide();
});)

if ($(#link-three).mouseenter(function() {
    $(#box-three).show();
    $(#box-one).hide();
    $(#box-two).hide();
});)

Self critique: my code doesn’t scale well with the addition of a new link/box combo. It seems very inefficient, but I’m not sure how else to achieve this. There is probably a better way to achieve a fade in/out transfer when a new box is to be shown. Any ideas are greatly appreciated.

Thanks!

  • 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-06T04:32:48+00:00Added an answer on June 6, 2026 at 4:32 am

    put the div id or class in the anchor

    <a href="#" rel="divName">...</a>
    

    bind click handler or hover or mouseenter (whatever you please) to the anchor, add a class if you want and just grab that divName to display it. Hide everything and display that one. You can do the same thing with li

    Something like

    $('.className').bind('mouseenter', function() {
        //grab the rel attribute
        var divName = $(this).attr('rel');
        // hide all boxes
    
        // show the right box
        $('#' + divName).show();
    });
    

    for hiding I would group your boxes in a div so you can target it better

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

Sidebar

Related Questions

Let me begin by saying this; I know that similar questions exist, but they
(Let me begin by saying that a) I appreciate this is the wrong place
Let me begin by saying I am not an extremely experienced programmer and would
Let me begin by saying my Oracle knowledge is minimal. We have a proprietary
First, let me begin by saying that I have done a lot of research
Let me begin this topic by explaining my background experience with web design. I
Let me begin by stating that this is a question of aesthetics. I've solved
Let me begin by saying that, yes, I know that the stock Android lock
Let me begin by stating, I'm not a COM developer. I know standard C++,
To begin with, let me say that I understand how and why the problem

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.