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

Submenu alignment - [Solved]


Poster: bgraves
Dated: Saturday July 16 2005 - 22:56:03 BST

Hi,

I would like to use the Milonic menu on an ecommerce website that I’m creating but have had trouble getting the submenus to align correctly.

My current efforts can be seen here: https://www.hcoms.co.uk/product_group.php

What I would like is for the submenus to all appear in the same place, aligned to the left. At the moment easch submenu opens under its parent main menu item.

Can this be done when using a relatively positioned main menu?

Thanks,

Ben.


Poster: slackbladder
Dated: Sunday July 17 2005 - 0:23:12 BST

Hi,

Try using:

screenposition="center"; left="offset=-195";

example:

Code:
with(milonic=new menuname("Milonic")){
orientation="horizontal";
style=subMenuStyle;
screenposition="center"; left="offset=-195";
aI("align=center;text=Products;url=http://www.milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://www.milonic.com/contactus.php;");
aI("align=center;text=Newsletter;url=http://www.milonic.com/newsletter.php;");
aI("text=FAQ;url=http://www.milonic.com/menufaq.php;");
aI("align=center;text=Discussion Forum;url=http://www.milonic.com/forum/;");
}


Poster: Ruth
Dated: Sunday July 17 2005 - 0:33:59 BST

Hi,

[This is based on the submenus you now have in which the first two submenus have few items in them, because of that these need to be left as they are or it looks strange.]

The best you could do is to leave those first two items which call a submenu as they are and then set the next ones all to screenposition="center";

The reasoning is this: let's assume you set screenposition="left"; left="offset=16"; All the submenus would then open right inside the left border of the blue submenu area, but ONLY at resolution 800x600. As soon as you change resolution, that left="offset=16"; is no longer enough, it would need to be something like 40 or something at 1024x768, and even more at higher resolutions.

If you are going to have more items in the first main menu items that call submenus you could set all of them to screenposition="center"; That seems to work in IE5.5, Netscape7.1, Firefox 1.0.2, Opera 7.54.

As a final note, I think you need to make that div 56px instead of 54px. At 56 it sits inside that blue area and shows both the top and bottom border of that area in all the above mentioned browsers.

Ruth

Can I force the width of the submenus and then centre them?


Poster: bgraves
Dated: Sunday July 17 2005 - 16:26:23 BST

If I set the width of the submenus to be the width of the sites content and then centre them, this should work.

Can I set the width to be fixed and centre them?


Poster: slackbladder
Dated: Sunday July 17 2005 - 16:42:01 BST

Did my suggestion not work? I re-created your page and it worked for me (ie5.5 FF for MAC and ie6 for PC)


Poster: Ruth
Dated: Sunday July 17 2005 - 18:40:21 BST

Hi Slack,

I'm going to have to check a second time before I post. I cross-my-heart there was no answer when I started working on the issue :D

slackbladder wrote:
Did my suggestion not work? I re-created your page and it worked for me (ie5.5 FF for MAC and ie6 for PC)


Yes your suggestion worked. I guess you could say [not realizing you had responded] I was just adding to it, since it only works when the resolution is set at whatever it was you had it when you did the left="offset=-195";

As soon as you change resolution the left="offset= has to be a different minus number. If it gets set up so that it's centered only then there's never a worry about that offset number when resolution changes.

bgraves wrote:
If I set the width of the submenus to be the width of the sites content and then centre them, this should work.

Can I set the width to be fixed and centre them?


How do you plan on setting the width of the submenus to be the width of the site's content? What happens when the resolution changes? Will that be a problem? What happens when someone changes their text-size in Netscape, Firefox, and other browsers [other than IE] which seem to link that browser textsize feature to the 'user stylesheet' feature? If none of those issues causes the content to change, then you could try setting menuwidth="X"; in the submenu. If that doesn't do it, you can try setting itemwidth="X"; in each item, making the sum of those widths equal to the content.

Ruth


Poster: slackbladder
Dated: Sunday July 17 2005 - 19:44:05 BST

Hi Ruth,

Quote:
I'm going to have to check a second time before I post.


I wouldn't worry - I normally give duff advice :D (is helping me to learn)

I am a bit confused though (its normally the case!) - I did adjust the screen res on both PC and Mac and it didn't affect my re-created page. I was guessing (as are most of my answers :lol: ) that:

screenposition="center"; left="offset=-195";

meant center the menu, then offset to the left by 195px. As the HTML page is fixed width it would not matter what the screen res is (it would if the site was variable table width)?

Wow! It's like learning a new language for me :lol:


Poster: Ruth
Dated: Sunday July 17 2005 - 21:04:21 BST

:oops: :oops:

Ben, use what Slack wrote. That will work, you only have to figure out the 'distance' to offset it from center, and -195 is probably pretty close.

slackbladder wrote:
I wouldn't worry .... (is helping me to learn) ......


So am I still learning. Mostly I have to 'make' the page to try things, can't do like the program guys who read and can see it in their head.

And, you should be confused!!! You are RIGHT. :oops: I was so focused on his wanting the menu to open at the left, that if you note my 'reason why' for the screenposition="center"; I was talking about setting it screenposition="left"; and using offset. When the offset messed up at resolution change I never even considered it when I tried out screenposition="center"; :oops: :oops:

But, hey, I bet I don't forget that again :)

Ruth


Poster: slackbladder
Dated: Sunday July 17 2005 - 21:15:26 BST

I like trying to sort others problems out - helps me to learn myself. I also like reading your answers, they are very well written and help me to understand :D It was one of your previous posts that made me think about using screenposition=center - so you kinda answered this one :D


Poster: Andy
Dated: Monday July 25 2005 - 10:34:08 BST

Hi slackbladder,

Quote:
I like trying to sort others problems out - helps me to learn myself.


I see you are helping out quite a bit lately, these things don't go un-noticed and I'd just like to say a quick thanks for helping others out, it's most appreciated by all here at Milonic.

If there is anything we can do for you, just let us know :D

Cheers,
Andy


Poster: slackbladder
Dated: Monday July 25 2005 - 11:33:04 BST

Hi Andy,

Thx for that - it's nice to be appreciated :D and I am glad to help out where I can (although my answers aren't always right - hopefully they are always helpful).

Nice team and a great product :D keep up the good work.

Tony