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

Shai Gluskin shai at content2zero.com
Sun Feb 28 03:37:20 UTC 2010


Luke,

Thanks so much. Your suggestion at the bottom was perfect. It didn't bring
the effect I was going for, but it produced a really clean look. My concept
there was unnecessarily complex and the results that came about from your
suggestion are perfect.

Shai

On Sat, Feb 27, 2010 at 6:58 PM, Luke <drupal at lists.tacticus.com> wrote:

> (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
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100227/5efc1fd6/attachment.html 


More information about the support mailing list