Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:35

mouseover issue


Poster: jz18
Dated: Thursday May 10 2007 - 3:17:52 BST

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.


Poster: Ruth
Dated: Thursday May 10 2007 - 18:36:30 BST

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


Poster: jz18
Dated: Friday May 11 2007 - 1:48:47 BST

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


Poster: Ruth
Dated: Friday May 11 2007 - 4:09:30 BST

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:
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:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=10;
aI("text=Home;url=http://www.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


Poster: Ruth
Dated: Friday May 11 2007 - 4:09:56 BST

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:
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:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=10;
aI("text=Home;url=http://www.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


Poster: jz18
Dated: Monday May 14 2007 - 1:41:53 BST

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!


Poster: Ruth
Dated: Monday May 14 2007 - 6:12:42 BST

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