Is it possible to have sub-menu items each a different color

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dmacman
Super Advanced
Super Advanced
Posts: 59
Joined: Wed Sep 21, 2005 3:49 pm

Is it possible to have sub-menu items each a different color

Post by dmacman »

Hi All,

I was wondering, is it possible to have the different lines in a sub-menu use different color schemes?

IE:

1st Submenu item (background is red, and text is white)
2nd Submenu item (background is blue, and text is white)
3rd Submenu item (background is green, and text is back)

The reason is, some of the items I am using the menu for have different color schemes, and I would like to use similar colors for that item (choice) in the sub menus.

Thanks a bunch,

Don
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

Post by Shap5202 »

just set up different menu classes for each sub menu you want and assign that class to the menu.

Code: Select all

with(milonic=new menuname("name1")){
			style=mainStyle;
        aI("showmenu=name2;");
}

with(milonic=new menuname("name2")){
			style=nextStyle;
aI("showmenu=name3;");
}

with(milonic=new menuname("name3")){
			style=thirdStyle;
}
something like that and just define the 3 different styles to have different colors


I'm sorry, i completely read your post wrong...
to actually answer your question, I believe you can definte different style at an item level.

in your aI() declaration, just change the style property you want there.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Shap is correct on the item declaration. Below my name you'll see links to style properties, menu properties and item properties. Many of the style properties which you declare in the style can also be declared in the item itself [check the item properties list] so you could declare offbgcolor=#ff0000;onbgcolor=x;offcolor=y;oncolor=w; and so on. That way you could do what you want, have each item a different offbgcolor, offcolor and onbgcolor, oncolor. You can even have different fonts, text decorations and so on.

Also, if you are trying to set up something where each submenu is the same, i.e. all submenus have 1st item red bg, 2nd item blue bg, 3rd item green bg and so on, you could simplify the process by creating css classes and calling the class using the offclass=myoffclass; onclass=myonclass; in the item.

Ruth
Post Reply