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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:15:08+00:00 2026-05-23T17:15:08+00:00

i have the following problem. I have a css dropdown navigation and if there

  • 0

i have the following problem. I have a css dropdown navigation and if there is a mouseover on the dropdown part of the navigation I want the background of the “navigation heading” to keep its background color that it gets when there is a hover on it. Problem is if the user moves on and hovers over the dropdown, the hover state of the “navigation heading” goes back to “normal”. That’s why I thought I could use jquery to alter it.

But unfortunately I don’t know how to select the specific element.

Here is an example for the navigation:

<ul> 
                    <li> 
                        <p class="naviHead first">Finanzen</p> 
                            <ul> 
                                <li><a href="http://www.spardaxx.de/kredit" title="SparDaxx Ratenkredit">Ratenkredit</a></li>
                                <li><a href="http://www.spardaxx.de/baufinanzierung" title="SparDaxx Baufinanzierung">Baufinanzierung</a></li>
                                <li><a href="http://www.spardaxx.de/altersvorsorge" title="SparDaxx Riester Rente">Riester Rente</a></li>
                            </ul> 
                    </li> 
                </ul> 

So if the user hovers over the p tag, the dropdown ul opens. Now I want to change the background color of the p if someone hovers over the following ul..

here is my jquery so far

$().ready(function() {
            $('#TopNav ul ul').mouseover(function() {
                 $(this).parents('p.naviHead').filter(':first').css("background", "black");


            })
        });

I guess the solution i simple, but I have no idea.. So any help is appreciated. Thx! 🙂

  • 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-23T17:15:09+00:00Added an answer on May 23, 2026 at 5:15 pm
    $(this).prev().css("backgroundColor", "black");  
    

    or if you have a more complex layout then –

    $(this).parent().find('p.naviHead').css("backgroundColor", "black");
    

    may be better

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

Sidebar

Related Questions

I have the following css settings: .dropdown dt { background:#e4dfcb !important; } .dropdown-disabled {
I have the following problem: I want to use images for my navigation, because
I am using CSS rounded corners for firefox and I have the following problem
I have the following code $(function() { $('#totalRecords').css('visibility', 'hidden'); alert(hi); }); Problem is that
i have got the following problem: I want to create a new Liferay Theme
I'm having a little problem with the css display property. I have the following
Basically, I am building a horizontal navigation bar. I have following markup: <ui:style src=../common.css
I have the following 4 divs with the CSS below. The problem is, the
I have the following problem. I have done the following: In my css file,
I have the following problem: My css is the following: .SPImage img { margin-top:-15px;

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.