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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:05:03+00:00 2026-06-03T02:05:03+00:00

I have a menu with sub-menu child navigation as well, and I’m trying to

  • 0

I have a menu with sub-menu child navigation as well, and I’m trying to append a class to the parent of the children based on the hovering of the children’s <ul> container.

This is what I have so far: http://jsfiddle.net/2KhnX/15/

but as you can see, the class never gets appended. If I strip most of the CSS from the HTML, but leave the class I’d like appended, it works fine – http://jsfiddle.net/2KhnX/21/

Which leaves me to believe that the CSS is conflicting or ruining the event that the JQuery is attempting to carry out. My guess would be because I’m using the parent > child rules of CSS, or perhaps because .sub-menu has an initial property of display:none. I’m not sure, I just know that the CSS is messing this up, or that I’m not using the appropriate selector because of the CSS.

Any insight would be greatly appreciated, for I am lost.

  • 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-03T02:05:04+00:00Added an answer on June 3, 2026 at 2:05 am

    This is the offending css:

    ul.menu li a:link, ul.menu li a:visited {
            background: url('images/alink.jpg') top center repeat-x;
    }
    .parenthovered {
        /* stuff */
    }
    

    Those first selectors have a higher specificity than the .parenthovered selector, and thus are taking precedence. You can address this in a few ways; one way is to be less specific on the first set of selectors, and more specific on the second selector:

    a:link, a:visited {
            background: url('images/alink.jpg') top center repeat-x;
    }
    
    .menu a.parenthovered {
        /* stuff */
    }
    

    Of course, you’ll have to choose selectors that make sense for the rest of your page…

    working fiddle: http://jsfiddle.net/pabo/NR4yB/1/

    Also, removing this line works too:

    background: url('images/alink.jpg') top center repeat-x;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make the sub-menu horizontal. In my HTML it looks
i have the menu structure like below, <ul> <li style=background-image:ur('open.gif');> <ul class=sub-menu> ........... </ul>
I have menu structure like below, <ul class=sub-menu> <li class=menu-item menu-item-type-post_type menu-item-object-page menu-item-34 id=menu-item-34><a
i have menu like this <ul> <li> <a href=#>Home</a> <ul class=sub> <li>Text</li> <li>Test</li> </ul>
i have been working on this sub-menu for 8 hours now, the last little
I have a dropdown (ul.sub-menu) with items inside (ul.sub-menu > li) that I'd like
I have a menu click event that looks something like this.... Public Sub ToolbarManager_ToolClick(sender
I have a menu system where when you click on a link, sub-headings will
I have a Menu class that has a IQueryable property called WebPages. In the
In Silverlight 3, I am trying to create a pop up menu for navigation.

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.