Solved

jQuery hover: child

Posted on 2009-07-13
1
441 Views
Last Modified: 2012-05-07
Hi,

If I have a <ul> with class "nav" can someone quickly tell me what's the jQuery equivalent to this css (which of course doesnt work in IE6):

I am using this for a drop down menu - when you hover over a menu item with a drop down list, the main menu item should remain highlighted.

.nav li:hover > a  {
    background:red;
   color:white;
}

Cheers,

Daisy
0
Comment
Question by:daisydoos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 24838562
Use the hover method : Using two anonymous functions : one for mouseover 1 for mouseout
$(".nav li").hover(
	function() {
		$(this).children("a").css({ "backgroundColor" : "red", "color" : "white" });
	},
	function() {
		$(this).children("a").css({ "backgroundColor" : "", "color" : ""});
	}
);

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question