Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jQuery hover: child

Posted on 2009-07-13
1
Medium Priority
?
443 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
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…

722 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