[support] Apply CSS to Parent on a Hover State for a Child

Luke drupal at lists.tacticus.com
Sat Feb 27 23:58:38 UTC 2010


(Don't get your hopes up--this is probably not an answer)

On Fri, 26 Feb 2010, Shai Gluskin wrote:

> I'm using nice menus. Primary nav has a background for a hover state. Some
> of the primary navs have children which are drop-downs as implemented via
> Nice Menus.
>
> The problem I am having is that I want the hover state for the primary nav
> to stick when using the drop down. Right now, when you mouse down over the
> dropdown links the hover state disappears.
>
> The relevant css is:
>
> #primary ul a {
> background-color: #ffffff;
> }
>
> #primary ul a:hover {
>  background-color: #e7e7e7; // I want this declaration to stick, even when
> the children are being hovered over!
> }

If you mean what I think you mean, I have not heard of a way to do this in 
CSS. Maybe some javascript to run onmouseover of the children, which 
temporarily changes the main "#primary ul a" element, switching 
"background-color: #ffffff;" for "background-color: #e7e7e7;"?

> #primary ul li ul li a {
>  background-color: #e7e7e7;
> }
>
> #primary ul li ul li a:hover {
>  color: #ffffff;
>  background-color: #0f6cb6;
>  }

I'm a little lost here, having not used the module and being a little 
rusty on my CSS, but would deleting this last block do it for you?

Luke


More information about the support mailing list