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:27

trouble with menualign


Poster: nethosters
Dated: Tuesday October 16 2007 - 22:13:34 BST

I'm running out of ideas and wondering if anyone can tell me what I am doing wrong. Here is my test page:

http://www.mitchstuart.com/beta/business/

My client would like to have the three sub menus center aligned below the corresponding suitcase icons. I expected that menualign=center would do it, but it stays left aligned no matter what. I also tried setting left=10, which would have the same effect, but that parameter is being ignored too. It must be something stupid - any suggestions would be appreciated!

Re: trouble with menualign


Poster: John
Dated: Tuesday October 16 2007 - 22:21:07 BST

First thing that's required is an update to your menu code. You're running v5.719, which is over 2 1/2 years old :!:

Current version (required for help here on the forum) is v5.785.

Let us know when you're up to snuff.

Re: trouble with menualign


Poster: nethosters
Dated: Wednesday October 17 2007 - 17:52:03 BST

Ok John, I've taken your advice and renewed the license for this site, and uploaded the new source files.

Re: trouble with menualign


Poster: Ruth
Dated: Wednesday October 17 2007 - 23:26:38 BST

Hi,

To start, menualign doesn't do anything with the alignment of the whole menu, it is to align all the items inside the menu, not the text but the actual items. So, let's say you set a horizontal menu of width 800px and you had 10 items but you set their width to 75px, that equals 750. Menualign center would shift those items so that there was equal space on the right and left sides of the menu.

Now, as to what you want. Since this is a horizontal menu the subOffsets do not apply, they are not really needed with horizontals, so to shift the submenu you need to use the properties top="offset="; and left="offset=" in the submenus. Since you have a fixed width parent item which is 10px wider than the sub menu's width you'd set the left="offset=5";

Just some other quick notes to give you information. I notice you have 3 styles for submenus because of the colors. There is an easier way to set those up so you don't have to do all that complete style 3 times. You would do the full menuStyle2 as you have it, then with the others you could do this and you'll see the only coding you did was for the off and on color settings.

Code:
menuStyle3=new copyOf(menuStyle2);
menuStyle3.onbgcolor="#539BC3";
menuStyle3.oncolor="#000000";
menuStyle3.offbgcolor="#036CA7";
menuStyle3.offcolor="#FFFFFF";

menuStyle4=new copyOf(menuStyle2);
menuStyle4.onbgcolor="#DA8893";
menuStyle4.oncolor="#000000";
menuStyle4.offbgcolor="#C95160";
menuStyle4.offcolor="#FFFFFF";


Your about submenu would have this and the others of course would just have the style=menuStyle3; or menuStyle4;

Code:
style=menuStyle2;
menuwidth=109;
menualign="center";
left="offset=5";


I added the menuwidth=109; but you could say make that 113 and then with the menualign="center"; in it, the items when you moused over them would show as having 2px space on the left and right of them before the menu's edge. I didn't use top="offset="; but you could also use that to move the menu down or up some pixels from the main menu image bottom edge.

Just a couple more notes, alwaysvisible is not a style propery, it is only a menu property, menualign is also only a menu property as is menuwidth and height. Imageheight and width are style properties and items properties so you could just put the imageheight=110; imagewidth=119; up in the style for that main menu instead of coding it in all the items.

Hope this helps.

Ruth

Re: trouble with menualign


Poster: nethosters
Dated: Thursday October 18 2007 - 0:00:47 BST

Ruth, you are a genius. Thanks a million.