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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:27:34+00:00 2026-05-17T17:27:34+00:00

I’m trying to disable the hover functionality for a menu. I want it to

  • 0

I’m trying to disable the hover functionality for a menu.
I want it to be enabled only under certain conditions.
I’ve tried using $(".ulColor").removeClass('hover');, but that hasn’t worked
The CSS code for enabling the hover is :

li:hover ul, li.over ul { display: block; }

Here is the HTML DIV inside which the menu resides –

<div id="pColorSelectorDiv" class="parentOfAll">  
    <ul id="colorNav" class="ulColor">  
        <li id="liColorNav" ><a id="colorSelected" class="firstAnchorChild">Colors</a>  
            <ul id="ulColorChild" class="ulColor">  
                <li><a id="bkgColor-1" class="bkgColor-1 anchorClass" name="colorPallete" onclick="colorPicked('1');">COLOR</a></li>  
                <li><a id="bkgColor-2" class="bkgColor-2 anchorClass" name="colorPallete" onclick="colorPicked('2');">COLOR</a></li>   
               <li><a id="bkgColor-3" class="bkgColor-3 anchorClass" name="colorPallete" onclick="colorPicked('3');">COLOR</a></li>   
           </ul>  
        </li>  
    </ul>  
</div>

Here is the rest of the CSS code :

div[id="pColorSelectorDiv"] ul {  
    margin: 0;  
    padding: 0;  
    list-style: none;  
    width: 50px; /* Width of Menu Items */  
    border-bottom: 1px solid #ccc;  
    }  

div[id="pColorSelectorDiv"] ul li {  
    position: relative;  
    } 

.firstAnchorChild{  
    display: block;  
    text-decoration: none;  
    color: #777;  
    background: White; /* IE6 Bug */  
    padding: 5px;  
    border: 1px solid #ccc; /* IE6 Bug */  
    border-bottom: 0;  
    cursor: pointer;  
    }  


li ul {  
    position: absolute;  
    left: 49px; /* Set 1px less than menu width */  
    top: 0;  
    display: none;  
    background: White;  
    }  


/* Styles for Menu Items */  
.anchorClass{  
    display: block;  
    text-decoration: none;  
    color: #777;  
    background: White; /* IE6 Bug */  
    padding: 5px;  
    border: 1px solid #ccc; /* IE6 Bug */  
    border-bottom: 0;  
    cursor: pointer;  
    }  

.bkgColor-1 {background: #00FFFF; color: #00FFFF;}  
.bkgColor-2 {background: #0000FF; color: #0000FF;}  
.bkgColor-3 {background: #7FFF00; color: #7FFF00;} 
  • 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-17T17:27:34+00:00Added an answer on May 17, 2026 at 5:27 pm

    I think you want

    li.hover:hover ul { display: block; }
    

    instead of

    li:hover ul, li.over ul { display: block; }
    

    Now this style will affect ul only when li is hovered and has hover class.

    A simplified example.

    PS You might also benefit from using ‘code sample’ button on edit form (the one with zeroes and ones) to format your code. Among other things, it’ll preserve indentation (and thus increase readability). The key combination is ctrl+K. I’ve edited one of your code samples to demonstrate it.

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

Sidebar

Related Questions

No related questions found

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.