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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:01:47+00:00 2026-05-12T17:01:47+00:00

As topic says, I want to remove the visability while i hover a list

  • 0

As topic says, I want to remove the visability while i hover a list on every <li> element except the one I hover.

This should be pretty simple i believe but I can’t figure it out.

Here is my markup:

<ul>
    <li class="item1"><a href="#">ITEM 1</a></li>
    <li class="item2"><a href="#">ITEM 2</a></li>
    <li class="item3"><a href="#">ITEM 3</a><li>
    <li class="item4"><a href="#">ITEM 4</a></li>
</ul>

and here are the jQuery (that doesn’t work):

$(document).ready(function(){
    $("li").hover(function(){
    $("li a").not(this).css("visibility", "hidden");    
    });
});

Something is wrong…

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-05-12T17:01:47+00:00Added an answer on May 12, 2026 at 5:01 pm

    Your .not(this) won’t work because this is an li element but you’re selecting a elements.

    You can do it like this (added code to unhide on hover out):

    $(document).ready(function(){
        $("li").hover(function(){
        $("li a").not($('a', this)).css("visibility", "hidden");
        }, function(){
        $("li a").css("visibility", "visible");
        });
    });
    

    Also you have a typo in your HTML – an <li> where there should be a </li>.

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

Sidebar

Related Questions

As the topic says, I want to be able to run a specific command
I am having some troubles with my script.. when I access http://www.domain.com/this-is-a-topic I want
As the topic says I cannot import this package in my web dynamic project
In this Redis Pub/Sub topic It says this: subscribe : means that we successfully
I guess the topic says it. I have tried googling this, but havent gotten
The topic says it all. Using Compact Framework C# I'm tiling (order/sequence is important)
The topic says it all. I have a dictionary of dictionaries(yes, it's a dictionaryception!)
as the topic says, my upper div starts from the margin of the lower
This topic has been covered on this forums, but I haven't found a working
This topic has been scratched once or twice, but I am still puzzled. And

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.