level-based classes for drop-down menus

danigrrl - July 2, 2009 - 21:42
Project:Nice Menus
Version:6.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm trying to do Sliding Doors with Suckerfish on Nice Menus and failing miserably. What I'd like to do is to give the top-level LI's a subclass of "tab" so that only they receive the background image, and the children will just have a color; however, nothing I do seems to allow that. Is this a feature that either a) can be added, or b) is intended to be added? It seems like a common-sense thing, but I can't find it anywhere.

#1

maryannking - August 4, 2009 - 19:22

Sliding doors require span tags around the menu item -- to view, check my development site: http://mngastro.advantagelabs.com (I am using sliding doors for angled tabs)-- added the function theme_links to the template.php file to add the span tags to the menu links

my difficulty is with the last dropdown.

#2

maryannking - August 4, 2009 - 19:47

Sliding doors require span tags around the menu item -- to view, check my development site: http://mngastro.advantagelabs.com (I am using sliding doors for angled tabs)-- added the function theme_links to the template.php file to add the span tags to the menu links

my difficulty is with the last dropdown.

#3

naught101 - August 14, 2009 - 09:16
Title:sub-class for top-level LI?» level-based classes for drop-down menus
Priority:critical» normal

Ideally, it would make sense to have a different class for each level. ie. nice-menu-level-0 for top level, nice-menu-level-1 for the first child, etc.

As a work-around, you can do this:

#block-nice_menus-1 .content>ul>li { /* .content is the div surrounding the main menu ul */
css for top-level here
}

#block-nice_menus-1 li ul {
css for sub-menus
}

#block-nice_menus-1 li li {
css for sub-menu items
}

If you need more levels, just add more "li"s.

#4

naught101 - August 14, 2009 - 12:30
Status:needs review» active

#5

danigrrl - August 14, 2009 - 21:37

I agree with this. If we just had a class called "top-level" or something that was specific to the top level of the menu, that would be perfect, since I think there's already a "children" class on the sub-menus. What I'm experiencing is that the settings I'm putting for the top-level li's are passing down to the children, no matter what I try to do, and the hover state on the top tabs disappears when you move on to the dropdown.

#6

naught101 - August 15, 2009 - 03:22

danigrrl: did you try "#block-id .content>ul>li"? it works fine for me... although not in ie6, 'cause ie6 is crap: http://www.webdevout.net/browser-support-css#css2selectors . Thankfully, it's on its way out.

 
 

Drupal is a registered trademark of Dries Buytaert.