Center Submenu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
fergusonkw
Beginner
Beginner
Posts: 1
Joined: Mon Aug 10, 2009 10:51 pm

Center Submenu

Post by fergusonkw »

I searched the forums and couldn't seem to find anything, but I'm wondering if it was possible to center the submenu's horizontally off of the corresponding main menu button (which is also horizontal). I don't know how to explain it other than if I had 7 items in the main menu (listed horizontally) and had 3 sub items that corresponded to the main menu - middle item than the 3 menus would be centered off of that main button as follows:

Top Line is the main menu and bottom line is the submenu. The dashes are just placeholders and represent nothing

1234567
---123

The 3 options of the submenu are centered off of the middle button (the one that these 3 submenus correspond to).
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Center Submenu

Post by Ruth »

Hi,

This is actually more difficult than it seems it would be. In order for me to try and figure out a way to do it, I actually need to see the data file and a test page with the layout you will be using. Here is a post that gives information on getting the x coordinate from an item in a main horizontal menu in order to have the submenus be set where you want them. viewtopic.php?t=3632

Now, as you'll see it is very involved, well, at least for those who don't know programming or js it is involved. But, there are some other options depending on your layout. For example, if your main horizontal menu is going to be centered in the page using screenposition="center"; then you can use the same thing for the submenus and then they would open at what looks to be the 'centered' position of the menu, but that is because the main menu is also set as centered on the page. The other option, if you are using images, then you should be able to set the submenus based of offsets because you would know the width of the images, so you could add them up and figure out how to set the left offset. So, if you can give me your data file and layout, I could try and figure out if it is possible and if so how to do it.

Ruth
Post Reply