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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:55:52+00:00 2026-06-04T19:55:52+00:00

I have a list with items. Based on what item I’m hovering over, I

  • 0

I have a list with items. Based on what item I’m hovering over, I want to show only the one div with associated content and hide all the rest.
The list has about 22 items, so there is 22 different div’s I need to switch between (show/hide).

Is there some quick solution to accomplish this with jQuery?

This is how I have set it up at the moment as a sarting point:

<div id="list-of-items">
    <ul>
        <li id="item1">item1</li>
        <li id="item2">item2</li>
        <li id="item3">item3</li>
        <li id="item...">19-more-items</li>
    </ul>
</div>

<div id="content1">content1</div>
<div id="content2">content2</div>
<div id="content3">content3</div>
<div id="content...">...</div>
  • 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-04T19:55:55+00:00Added an answer on June 4, 2026 at 7:55 pm
    $('#list-of-items li').on('mouseenter mouseleave', function(e) {
        $('#content'+this.id.replace('item', ''))[e.type==='mouseenter'?'show':'hide']();
    })​;​
    

    FIDDLE

    EDIT

    I think this is what you are looking for:

    $(function(){
        $('#list-items li').on('mouseenter', function() {
            $('#content'+this.id.replace('item', '')).show().siblings().hide();
        });
    });
    

    FIDDLE

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

Sidebar

Related Questions

I have a list of items. Item is a object with two fields. One
I have to make a graph based on a list of items. For this
I have a list of items, and I want to find a list of
I have a list of items <div id=item1>somestuff</div> <div id=item2>somestuff</div> <div id=item3>somestuff</div> When someone
Have/Want List Matching Algorithm I am implementing an item trading system on a high-traffic
I have a list view that can display items based on internal state (it
My goal is to have a list of items each item has an image
I have code that adds list items to an unordered list, and associated with
I have a list of content items, each with a set width but different
I have the following issue: I'm generating a Top10 list of items, based on

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.