Submenu center align below mainmenu items

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Lucas
Beginner
Beginner
Posts: 2
Joined: Fri Mar 31, 2006 4:01 pm

Submenu center align below mainmenu items

Post by Lucas »

Hi all!

Wondering if anyone can help me out, I'm trying to get the submenus which drop down from the main menu bar to be centrally aligned underneath the button/menu heading they drop from.

I've seen a post from 2004 which tackled this same issue but it doesn't appear to have been solved in it. Any new developments?
http://milonic.com/mfa/2004-February/003680.html

So you know I'm using the 100% width Milonic menu and the js coding is below.

Thanks in advance to any who take the time to reply to this.

Lucas.





fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling

problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;




with(ScrollingSampStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="comic sans ms,verdana,helvetica";
align="center";
fontsize="13px";
fontstyle="normal";
fontweight="normal";
offcolor="#000000";
oncolor="#6C2DC7";
onbgcolor="#00FFFF";
padding=3;
}

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
itemwidth="1%";
menualign="center";
menuwidth="100%";
orientation="horizontal";
style=ScrollingSampStyle;
top=10;
aI("status=Back To Home Page;bgimage=blue_back.jpg;text=Home;url=http://www.mpbc.org.uk;");
aI("showmenu=About;bgimage=blue_back.jpg;text=About Us;");
aI("showmenu=Resources;bgimage=blue_back.jpg;text=Resources;");
aI("showmenu=Kids;bgimage=blue_back.jpg;text=Kids’ Corner;");
aI("showmenu=Contact;bgimage=blue_back.jpg;text=Contact Us;");
}


with(milonic=new menuname("About")){
overflow="scroll";
style=ScrollingSampStyle;
aI("text=Who We Are;url=;")
aI("text=What We Believe;url=;")
aI("text=What We Do;url=;")
aI("text=Mission;url=;")
}

with(milonic=new menuname("Resources")){
style=ScrollingSampStyle;
aI("text=Useful Links;url=;");
aI("text=Books;url=;");
aI("text=Question For God;url=;");

}

with(milonic=new menuname("Kids")){
style=ScrollingSampStyle;
aI("text=Kids’ Zone;url=;");
aI("text=Kids’ Books;url=;");
aI("text=Kids’ Links;url=;");
aI("text=Parents’ Info;url=;");
}

with(milonic=new menuname("Contact")){
style=ScrollingSampStyle;
aI("text=Contact The Church;url=;");
aI("text=Where We Are;url=;");
}


drawMenus();
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

you can try to define a left=xxx; property in each of your submenus.

Example: something like

with(milonic=new menuname("Resources")){
style=ScrollingSampStyle;
left="offset=+10";

...

you have to find out to specify this value, can be negative too.

Michael
Lucas
Beginner
Beginner
Posts: 2
Joined: Fri Mar 31, 2006 4:01 pm

Post by Lucas »

Ok thanks for that, I'm guessing the offset is the only way to do this then and there's no 'centre' function which would set things as central even if the number of items in the menu bar changed.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

its a difference to align all menu items (or individual items, text alignment) centered, what you can do using
align 36 The align property sets the Text Alignment within all menu items.
Values: 'left', 'center' or 'right'
Example: align='center';
(Please see: http://milonic.com/itemproperties.php )

or - what obviously you would like to do, positioning the entire sub centered below the calling main item, this is possible only, using an offset as described.

Michael
Post Reply