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

Positioning of submenu *SOLVED*


Poster: slomo
Dated: Thursday April 5 2007 - 6:05:13 BST

Hi,

I'm stuck..
My menu has 3 levels..
I wanted to center the 2nd level menu under its 1st level. I am not sure how to explain this. Please see the attached image for a clearer explanation.

Image

mouseover [Menu] will shows me list of 2nd levels. I want those [L2 Menu x] to be centered under [Menu]..

How can I do this? Thanks!

All menu are in image, not text[/img]


Poster: Ruth
Dated: Friday April 6 2007 - 5:19:40 BST

Hi,

If you are using images for the menu items, then you should be able to use offsets to 'center' the submenu. So, let's say the image for the word Menu is 40px wide, and the images for the L2 Menu 1 is 100px wide, normally the left side of the submenu will open even with the left side of the main parent item, so using a left="offset=-30"; should shift that menu back toward the left by 30px thereby 'centering' it. Using images allows this to be done pretty easily, it's only with text you can't really use that since users' browser text size might be bigger or smaller.

Hope this helps.

Ruth


Poster: slomo
Dated: Monday April 9 2007 - 4:39:05 BST

sorry.. I don't quite get what you said. ;-p

Quote:
_menuCloseDelay=100;
_menuOpenDelay=100;
_subOffsetTop=0;
_subOffsetLeft=2;

with(AllImagesStyle=new mm_style()){
styleid=1;
bordercolor="#000000";
borderstyle="solid";
fontstyle="normal";
fontweight="normal";
padding=3;
}

with(menuStyle=new mm_style()){
bordercolor="#f6d9b0";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial, Helvetica, sans-serif";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#ffffff";
offcolor="#515151";
onbgcolor="#ffffff";
oncolor="#ffffff";
outfilter="Fade(duration=0.2);Alpha(opacity=100);Direction=135, Strength=5)";
overfilter="Fade(duration=0.2);Alpha(opacity=100);Direction=135, Strength=5)";
padding=0;
pagebgcolor="#82B6D7";
pagecolor="black";
separatorcolor="#2D729D";
separatorsize=0;
subimagepadding=0;
}

with(milonic=new menuname("Main")){
alwaysvisible=1;
orientation="horizontal";
style=AllImagesStyle;
position="relative";
aI("image=images/navi_menu/0_1_0.jpg;overimage=images/navi_menu/0_1_1.jpg;url=#;");
aI("image=images/navi_menu/0_2_0.jpg;overimage=images/navi_menu/0_2_1.jpg;url=#;");
aI("image=images/navi_menu/0_3_0.jpg;overimage=images/navi_menu/0_3_1.jpg;url=#;showmenu=L2 Menu;");
aI("image=images/navi_menu/0_4_1.jpg;overimage=images/navi_menu/0_4_1.jpg;url=#;");
aI("image=images/navi_menu/0_5_0.jpg;overimage=images/navi_menu/0_5_1.jpg;url=#;");
aI("image=images/navi_menu/0_6_0.jpg;overimage=images/navi_menu/0_6_1.jpg;url=#;");
aI("image=images/navi_menu/0_7_0.jpg;overimage=images/navi_menu/0_7_1.jpg;url=#;");
aI("image=images/navi_menu/0_8_0.jpg;overimage=images/navi_menu/0_8_1.jpg;url=#;");
}

with(milonic=new menuname("L2 Menu")){
overflow="scroll";
style=menuStyle;
aI("image=images/navi_menu/1_1_0.jpg;overimage=images/navi_menu/1_1_1.jpg;showmenu=subBM;");
aI("image=images/navi_menu/1_2_0.jpg;overimage=images/navi_menu/1_2_1.jpg;showmenu=subSyd;");
aI("image=images/navi_menu/1_3_0.jpg;overimage=images/navi_menu/1_3_1.jpg;showmenu=subKun;");
aI("image=images/navi_menu/1_4_0.jpg;overimage=images/navi_menu/1_4_1.jpg;showmenu=subPen;");
aI("image=images/navi_menu/1_5_0.jpg;overimage=images/navi_menu/1_5_1.jpg;showmenu=subKul;");
aI("image=images/navi_menu/1_6_0.jpg;overimage=images/navi_menu/1_6_1.jpg;showmenu=subPul;");
}

drawMenus();


The above is the menu_data.js for my menu. Where should I apply that left="offset=-30";?

thanks!

EDIT:
i tried to insert left="subset=-xx"; ..
Quote:
with(milonic=new menuname("L2 Menu")){
overflow="scroll";
style=menuStyle;
left="subset=-xx";
aI......


my 2nd level menu became slightly centered of Menu 3 instead..


Poster: Ruth
Dated: Monday April 9 2007 - 5:06:13 BST

Hi,

Well, I can't give you figures since I don't have your menu, i.e., the page with the menu and the images to be able to figure out the correct offset numbers.

One thing, I notice you have the main menu inside the menu data file and you have it set to be position='relative'; please read the information about positioning relative menus from the links found here

http://www.milonic.com/forum/viewtopic.php?t=8777

The beginners' example page is here:

http://support.milonic.com/beginners/ta ... /index.htm

As to where you put the offset, you put it in the submenu which is being opened. For example, if it has to be shifted back to the left by 30px you would code it as:

Code:
with(milonic=new menuname("L2 Menu")){
left="offset=-30";
overflow="scroll";
style=menuStyle;


Ruth


Poster: slomo
Dated: Monday April 9 2007 - 8:24:16 BST

thanks ruth!
i'll have a try

EDIT:
Done! and it's centered!
Actually I've made a mistake there.. I put subset=-xx instead of offset=-xx :P :lol: