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

Submenu center align below mainmenu items


Poster: Lucas
Dated: Friday March 31 2006 - 16:08:15 BST

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://www.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();


Poster: Migru
Dated: Friday March 31 2006 - 16:47:47 BST

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


Poster: Lucas
Dated: Tuesday April 11 2006 - 21:50:00 BST

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.


Poster: Migru
Dated: Wednesday April 12 2006 - 7:18:50 BST

Hi

its a difference to align all menu items (or individual items, text alignment) centered, what you can do using

Quote:
align 36 The align property sets the Text Alignment within all menu items.
Values: 'left', 'center' or 'right'
Example: align='center';


(Please see: http://www.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