menustyle
menustyle
Does anyone know if a menu will work if there is no style above menu items?
And can I put style in menuitems?
Thanks,
maz
And can I put style in menuitems?
Thanks,
maz
I played around with it jsut out of curiosity. I didn't declare any style in the head of my document, just put everything in the body tag for the bgcolor, font links etc of the page, then I tried eliminated any style reference to my submenus and went from there, this is the result.
1. I had to create a style, but I could leave it empty, only name it like this with(main=new mm_style()){}
2. I had to declare a style in the menu itself or I got an error
The menu took on the bgcolor and font color of the page for any item that only opened a submenu, but for any item that was a link it became the color listed for links.
I tried putting a different style for one item but that didn't seem to change the style.
Ruth
1. I had to create a style, but I could leave it empty, only name it like this with(main=new mm_style()){}
2. I had to declare a style in the menu itself or I got an error
The menu took on the bgcolor and font color of the page for any item that only opened a submenu, but for any item that was a link it became the color listed for links.
I tried putting a different style for one item but that didn't seem to change the style.
Ruth
Hi Maz,
You could declare a base or default style for common or default features, like borderstyle, borderwidth, etc. As you know, most of the menu style properties are also represented as menu item properties. That way, you can override a style setting that normally applys to the whole menu, and specify a different value to use on an item-by-item basis. With that in mind, you can take advantage of the fact that the argument to the aI() function is all in a long string, and do some string manipulations to create "item styles". Suppose, for example, that you have a style like so:
You could define an "item style" string in your menu_data.js file like this:
Define as many menu item properties in this string as you like, placing the entire string inside double quotes, separating each property from the next with a ; and ending the whole string with a ; inside the closing ".
Define as many different "item styles" as you want like this. To use one in a menu item definition, you would define the properties that are unique to the particular item, as usual (like text= and url=), and append the itemStyle to the end, like this:
This way, you could re-use any itemStyle you want in any item definition, as often or as little as you like. You don't have to keep typing all of the individual property definitions for each different menu item. And you can easily change the itemStyle that you've applied to multiple items simply by editing the string.
You could take the approach a step further and break the "item styles" into various parts, like "off styles" and "on styles", like so:
Then combine them in a menu item definition like so:
Is that the sort of thing you're after?
Kevin
You could declare a base or default style for common or default features, like borderstyle, borderwidth, etc. As you know, most of the menu style properties are also represented as menu item properties. That way, you can override a style setting that normally applys to the whole menu, and specify a different value to use on an item-by-item basis. With that in mind, you can take advantage of the fact that the argument to the aI() function is all in a long string, and do some string manipulations to create "item styles". Suppose, for example, that you have a style like so:
Code: Select all
with(menuStyle=new mm_style()){
onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="#DCE9F0";
offcolor="#515151";
bordercolor="#296488";
borderstyle="solid";
borderwidth=1;
separatorcolor="#2D729D";
separatorsize="1";
padding=5;
fontsize="75%";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="arrow.gif";
subimagepadding="2";
}
Code: Select all
itemStyle1 = "onbgcolor=#000000;oncolor=#0000FF;";
Define as many different "item styles" as you want like this. To use one in a menu item definition, you would define the properties that are unique to the particular item, as usual (like text= and url=), and append the itemStyle to the end, like this:
Code: Select all
aI("text=Your Text;url=yourUrl.htm;"+itemStyle1);
You could take the approach a step further and break the "item styles" into various parts, like "off styles" and "on styles", like so:
Code: Select all
offStyle1 = "offbgcolor=#FFFFFF;offcolor=#000000;subimage=arrow-off.gif;";
onStyle1 = "onbgcolor=#000000;oncolor=#FFFFFF;onsubimage=arrow-on.gif;";
Code: Select all
aI(text=Your Text;url=yourUrl.htm;"+offStyle1+onStyle1);
Kevin
Kevin,
I didn't know that one, I'll have to go over it carefully.
I had a style but the padding was different, could I have added top, right, bottom, left padding to the menu item?
I added a few styles yesterday, remember Ruth asked about 3d, I just noticed today I have no separators. Where did they go?
maz
I didn't know that one, I'll have to go over it carefully.
I had a style but the padding was different, could I have added top, right, bottom, left padding to the menu item?
I added a few styles yesterday, remember Ruth asked about 3d, I just noticed today I have no separators. Where did they go?
maz
Hi Maz,
Yep... you can specify padding as a menu item property, overriding the padding set in the menu's style. It might also be worth mentioning that when you define your "item style" strings, you could do so across multiple lines of code, likes this:
The advantage here would be that you set one property per line, so it might be easier to edit and manage that way. Just remember to end each line, except the last one, with a backslash (\) as shown above.
Don't know about your separators, but I'll take a look in a bit.
Cheers,
Kevin
Yep... you can specify padding as a menu item property, overriding the padding set in the menu's style. It might also be worth mentioning that when you define your "item style" strings, you could do so across multiple lines of code, likes this:
Code: Select all
itemStyle1="\
offbgcolor=#000000;\
onbgcolor=#FFFFFF;\
offcolor=#FFFFFF;\
oncolor=#000000;\
padding=5 50 5 50;\
"
Don't know about your separators, but I'll take a look in a bit.
Cheers,
Kevin
All these styles could get confusing.
It may be that the separators look fine on a pc, but what I'm seeing is the background through the separators where the separator should be.
I have another separator when logged in and that one works fine, the only difference is that there is no image background with bgcolor transparent.
Thanks,
maz
nb. Kevin, please can you take a look at the post "IE mac popup function" he needs some js help.
It may be that the separators look fine on a pc, but what I'm seeing is the background through the separators where the separator should be.
I have another separator when logged in and that one works fine, the only difference is that there is no image background with bgcolor transparent.
Thanks,
maz
nb. Kevin, please can you take a look at the post "IE mac popup function" he needs some js help.