mouseover issue

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jz18
Advanced
Advanced
Posts: 24
Joined: Thu May 03, 2007 2:37 am

mouseover issue

Post by jz18 »

Hello all,

Does anyone have idea how to change the color when the mouse over the
menu item. But I [b]only[/b] want to change the color when the menu item
is actually have a link(url) in the aI(). For those menu items without url
attached to them will remain the same color as mouse is not overed.

Any ideas?

Thanks.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Yes, according to the documentation, things like onbgcolor, oncolor etc,
that is those properties that have both an off and on state can be either
style properties, that is, placed in the menuStyle section, or item
properties, that is, placed in an item. You can therefore code those items
with url links in them to be whatever oncolor you want in that item's aI
string.

Ruth
Last edited by Ruth on Mon May 14, 2007 6:13 am, edited 1 time in total.
jz18
Advanced
Advanced
Posts: 24
Joined: Thu May 03, 2007 2:37 am

Post by jz18 »

Hi Ruth,

the property for onbgcolor and oncolor is for the menuItem, that's true!
But What i want is to enable the change the menuItem's bgcolor when the
menuItem has URL attacthed to it. for example the menuItem:

aI("text=contact us;");

this one is actually does not have url attached to it. Therefore, i hope the
color remains the same when the mouse onve it. So there is difference
between the menuItems with or without URL attached it them. Is there a
way to set this property?

Thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Yes, I understood that. To do it, you will have to code all the menu items
that have urls attached to them in the item

So, if your style for a particular menu is offbgcolor="#ffffff";
onbgcolor="#000000"; then if you code in an item that has a url in the
menu that uses that style, onbgcolor=#ff0000; then on that particular item
when you mouseover it will be red instead of black.

What I'm saying is that you can code the style for onbgcolor to be a
particular color, then in any of the items that have urls in them you would
code onbgcolor= and whatever color you want that particular item to be.

You have to do this manually, there is no property that says,
onbgccolorifitemurl="#ff0000";

So, let's say your menuStyle off and on colors and bgcolors are

Code: Select all

with(menuStyle=new mm_style()){
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ffffff";
oncolor="#ff0000";
}
Then your main menu uses this style and it has one url and you want the
item with the url have an onbgcolor of red and oncolor of black, these
would be the colors when you mouseover, then you would code like this

Code: Select all

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=10;
aI("text=Home;url=http://milonic.com/;onbgcolor=#ff0000;
oncolor=#000000;");
aI("showmenu=Samples;text=Menu Samples;");
aI("showmenu=Milonic;text=Milonic;");
aI("showmenu=Partners;text=Partners;");
aI("showmenu=Links;text=Links;");
aI("showmenu=MyMilonic;text=My Milonic;");
}
This means that that particular item when you mouseover it would be red
bg with black font color, it would be the only item like that, the others
would be black bg and red font color when moused over.

Ruth
Last edited by Ruth on Mon May 14, 2007 6:15 am, edited 2 times in total.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Yes, I understood that. To do it, you will have to code all the menu items
that have urls attached to them in the item

So, if your style for a particular menu is offbgcolor="#ffffff";
onbgcolor="#000000"; then if you code in an item that has a url in the
menu that uses that style, onbgcolor=#ff0000; then on that particular item
when you mouseover it will be red instead of black.

What I'm saying is that you can code the style for onbgcolor to be a
particular color, then in any of the items that have urls in them you would
code onbgcolor= and whatever color you want that particular item to be.

You have to do this manually, there is no property that says,
onbgccolorifitemurl="#ff0000";

So, let's say your menuStyle off and on colors and bgcolors are

Code: Select all

with(menuStyle=new mm_style()){
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ffffff";
oncolor="#ff0000";
}
Then your main menu uses this style and it has one url and you want the
item with the url have an onbgcolor of red and oncolor of black, these
would be the colors when you mouseover, then you would code like this

Code: Select all

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=10;
aI("text=Home;url=http://milonic.com/;onbgcolor=#ff0000;
oncolor=#000000;");
aI("showmenu=Samples;text=Menu Samples;");
aI("showmenu=Milonic;text=Milonic;");
aI("showmenu=Partners;text=Partners;");
aI("showmenu=Links;text=Links;");
aI("showmenu=MyMilonic;text=My Milonic;");
}
This means that that particular item when you mouseover it would be red
bg with black font color, it would be the only item like that, the others
would be black bg and red font color when moused over.

Ruth
Last edited by Ruth on Mon May 14, 2007 6:16 am, edited 1 time in total.
jz18
Advanced
Advanced
Posts: 24
Joined: Thu May 03, 2007 2:37 am

Post by jz18 »

Hello Ruth,

That's exactly what i am looking for. So in this case, the code (onbgcolor or oncolor or whatever) inside the menuItem aI(...) overrides the style in menuStyle, is my understanding correct?

Thanks again!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Yes, that's correct. You need to look at the links below my name and check out the different properties of the menu and where they apply. There are style properties, you put them in the style, there are menu properties and you put them in the actual menu part, like where you put alwaysvisible, and there are item properties. If you look at these you'll find that many style properties are also item properties, so they can be coded in both places. When in the style they will apply to all items in a menu using the particular style, and when in an item they will apply only to that item, while all the other items will be whatever is coded in the style for that menu.

Ruth
Post Reply