onClass and offClass

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

onClass and offClass

Post by Hergio »

Found alittle quirk in the onclass and offclass of the menu items and their relationship to the menu styles, not sure if its supposed to be or not.

I have two CSS styles that look like

Code: Select all

<STYLE> 
.myCSSstyle1{  /* red border, light red background */
      border: 3px red solid; 
      background: #ffeaf2; 
} 
.myCSSstyle2{  /*blue border, light blue background */
      border: 3px blue solid; 
      background: #eaf2ff; 
} 
</STYLE>
And in the my MENU STYLE, if I leave on/off background blank and onborder all blank too, the CSS STYLEs come through great on the menu item when a menu item has onClass=myCSSstyle1;offClass=myCSSstyle2. Wonderful.

Setting my on/off background colors in the MENU STYLE to a color overrides the onClass and offClass background, but the borders stay. This makes sense since the border makes it through, and the color gets added. But is the menu style property supposed to override menuitem on and off class definitions? I would think since you are defining them in the menu item they should take precedence over any global definitions. If I defined on and off class in the item, I would expect the rest of the menu to behave as the menu style says, but this one item would have different background colors since I put in the classes for it to use, right?

Also, if I specify the above classes and then set the onborder attribute of the MENU STYLE, when the menu loads the menu items have the style of the offclass style as expected. When I mouseover the item, I don't get the border of the onclass CSS style, I get the border of the onborder MENU STYLE, and I guess this is ok, you have to pick one to use, right? But when I mouse out of the item, I don't get the offclass style anymore, it seems to get wiped. Any of this by design?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Did you try it with transparent?

I tried it with border-bottom, although amazed it could take something not in the menu itself, the result was 2 border-bottom, one for the subimage.

Regards,
maz
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Its not a matter of I can't get something to work. Its just that I'd like to know what takes precedance, which styles should override others. And with the onborder thing, I would think offclass should restore itself as long as offborder is not specified, but it doesn't. And even then, if you do specify offborder in the style, shouldnt the offclass for the individual item override the offborder directive since its actually IN the item definition.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I assumed above, that I got 2 css bottom borders due to subimage, wrong again.

It didn't sit right with me the way it rendered, reading new posts, now I realize that this must also be created by 3D effect.

3D is ever present, even though I don't use borders or 3D on the top main menu. When I created a css bottom-border to the item it created the bottom border on the main item and a 2nd bottom-border to 3D.

Now its making sense.
maz
Post Reply