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

submenu positioning


Poster: drumbo
Dated: Wednesday October 25 2006 - 14:08:28 BST

Hi,

I have a 3 level menu. The 1st level is always visible (the main menu), the second and third both "pop up" when "moused over". I have used the _suboffsetlleft so that I can position the second submenu in the right place (25px to the right).
The problem is then that the 3rd submenu is also offset by the _suboffsetleft value. Is there anyway to make it that only the second submenu uses the _suboffsetleft value?

Thanks


Poster: kevin3442
Dated: Thursday October 26 2006 - 23:40:14 BST

Set _subOffsetLeft=0; and instead, apply a horizontal offset to each second-level menu individually using the left property in the menu definition, like so:

Code:
with(milonic=new menuname("Products")){
style=subStyle;
left="offset=25";
...
aI("...");
}


Since the offset values is defined in a string, you could also use a global string variable, in case you want to tweak it without having to edit every menu definition each time. Like so:

Code:
// Globals

_SubOffsetLeft = 0;
...
leftSubOffset = "offset=25";

...

// Menu defs

with(milonic=new menuname("Products")){
style=subStyle;
left=leftSubOffset;
...
aI("...");


Now, if you wanted to change the second-level offset to, say, 30 you would just edit the value assigned to leftSubOffset; e.g.,
Code:
leftSubOffset="offset=30";


Hope that helps,

Kevin


Poster: drumbo
Dated: Sunday October 29 2006 - 9:52:17 GMT

Hi Kevin,

Thanks for the answer. Unfortunately I don't seem to be able to get it to work.

These are my two styles (the rawcss in the 1st one is to get the padding to the right but I can't have an image now other wise the image is padded to the end and therefore does not sit where I want it)

with(HeadersStyle=new mm_style()){
offbgcolor = "transparent"
onbgcolor="#FFFFFF"
outfilter="randomdissolve(duration=0.5)";
overfilter="Fade(duration=0.2);Alpha(opacity=80);)";
padding=1;
imagepadding=0;
pagebgcolor="#FFFFFF";
pagecolor="black";
separatorsize=0;
subimagepadding=1;
if(ie){
rawcss="padding-right:12px;";
}
else{
rawcss="padding-left:10px;padding-right:35px;";
}
}

with(SubMenuStyle=new mm_style()){
left="offset=25";
offbgcolor = "#FFFFFF"
onbgcolor="#EC9B13"
outfilter="randomdissolve(duration=0.5)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);)";
padding=1;
pagebgcolor="#EC9B13";
pagecolor="black";
separatorsize=0;
subimage="/images/arrow.gif";
rawcss="padding-right:5px;";
}


Poster: kevin3442
Dated: Tuesday October 31 2006 - 2:35:44 GMT

Hi,

You've put left="offset=25"; in a menu style definition. It's a menu property, rather than a style property. You have to use it in the menu definition, rather than a menu style definition (e.g., as in the "Products" menu in the example I posted earlier). That may do the trick.

Hope that helps,

Kevin


Poster: drumbo
Dated: Tuesday October 31 2006 - 11:59:50 GMT

Doh, that was careless - sorry about that - will give it a try