pez wrote:MY QUESTION
I'm actually trying to change the menu colour according to a cookie set by a user.. Can do this with the rest of the site through css style sheet with php.
But can't find a way to change milonic menu... dont want to have to create separate menu-data.js files would prefer to read from a css style sheet.
Apart from doing it like the above can this be done another way??
Can I call menu colours etc from a css style sheet?
How?
You could use the
offclass and
onclass properties. These can be defineed as either
menu style properties or as individual
menu item properties (overriding the menu style setting if present). The general idea is to define the styles in your .css style sheet, like so:
Code: Select all
.menuOff
{
style definitions
}
.menuOn
{
style definitions
}
Then use them like so:
Used in a menu style definition:
Code: Select all
with(mainMenu=new mm_style()){
.
.
.
offclass="menuOff";
onclass="menuOn";
.
.
.
}
Used in a menu item definition
Code: Select all
aI("text=Item Text;url=whatever.htm;offclass=menuOff;onclass=menuOn;");
You may still want to set the basic menu style properties in the menu style definition, like offbgcolor and onbgcolor, etc., because NS4 will not be able to use the offclass and onclass properties. Although, to be honest, I don't know if offclass/onclass take precedence over the menu's internal style settings or vice versa; you might want to test this if you care about NS4.
A third property, pageclass, will let you specify styles for a "current page" highlight in the menu.
Now that you know the names of the properties (offclass, onclass, pageclass), you can find a lot more discussion about them using the forum's searach function.
Hope that helps,
Kevin