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

sub menu alignment problem with followscroll on main menu


Poster: dklugmann
Dated: Thursday September 9 2004 - 12:00:53 BST

Hi

I am using a vertical menu.

From this I have a submenu. This needs to be centred on the page to the
right of the main menu. This works fine with screenposition="middle" however if I use followscroll=1 on the main menu i can't use the screenposition="middle" on the submenu as it seems to refer only to the middle position of the original page not the middle position
once you have scrolled down a while.

If i take the screenposition="middle" statement out the submenu is not
aligned in the middle of the page.

A second minor issue is that the submenu when it opens slightly overwrites the main menu entry. Is it possible to make the submenu start exactly to the right of the main menu entry.

Many thanks

David Klugmann


Poster: Ruth
Dated: Thursday September 9 2004 - 17:00:52 BST

These are the codes in the menu_data.js file that control the submenus
Code:
_subOffsetTop=0              // Sub menu top offset
_subOffsetLeft=0            // Sub menu left offset


When they are set to 0, the submenu will have the top even with the top of it's parent item and the left even with the right side of your vertical menu.

You'll have to post more information on the other item. We need to see your coding on how you set it to have the submenu open at screenposition="middle" Since it is a submenu it should be controlled by the subOffsets. What version is your menu? You should find it at the top of the milonic_src file. A test page to see what you're doing would be the most helpful.

Ruth


Poster: dklugmann
Dated: Friday September 10 2004 - 10:40:04 BST

Ruth

Many thanks for your reply.

I noticed my submenu offsets were not set to zero so now i have now reset them.
As you explained the menus now open down from the previous menu and to the right of it.

What I wanted was to have the submenu open out centrally (and to the right) from the previous menu. Ie half the options above and half below.

Since I have lots of menus and the options may change I didn't want to use the _suboffsettop and _suboffsetleft as I would have to recalculate the values each time.

Is there a way of just telling a submenu to open either side vertically from it's parent option and not downwards.

The only way I could do it was to use screenposition="middle" in the sub menu. This seems to override the _suboffset values.

This works fine for me as my left main menu only has one item which is also positioned in the middle (vertically) of the screen.

The problem is with the followscroll=1 when you scroll down the screen the screenposition=middle no longer works for the submenu as it remembers the middle position as that midddle position of the original page. So when it opens up the submenu after you have scrolled down a bit it does it upwards of the parent menu. If you have scrolled down far enough you can't even see where the submenu is being opened as it is now off the page.

Basically I just need a way of opening a vertical submenu centrally from it's parent and not downwards.

I have enclosed the code below from my menu_data.js

Many thanks for your help.

David

_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=0 // The time delay before menus open on mouse over
_subOffsetTop=0 // Sub menu top offset
_subOffsetLeft=0 // Sub menu left offset



with(menuStyle=new mm_style()){
onbgcolor="#5253af";
oncolor="#ffffff";
offbgcolor="#5253AF";
offcolor="#ffffff";
bordercolor="#FFFFFF";
borderstyle="solid";
borderwidth=0;
separatorcolor="#FFFFFF";
separatorsize="0";
padding=5;
fontsize="75%";
fontstyle="normal";
fontfamily="Verdana, Arial, Tahoma";
fontweight="bold"
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
pointer="url('file://D:/cursors/Hand.USA.cur'), url('file://D:/cursors/Hand.USA.cur')";
outfilter="randomdissolve(duration=0.5)";
}

with(menuStyle2=new mm_style()){
onbgcolor="#FF99CC";
oncolor="#ffffff";
offbgcolor="#5253AF";
offcolor="#ffffff";
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=1;
separatorcolor="#FFFFFF";
separatorsize="1";
padding=5;
fontsize="75%";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
fontweight="bold"
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
pointer="url('file://D:/cursors/Hand.USA.cur'), url('file://D:/cursors/Hand.USA.cur')";
outfilter="randomdissolve(duration=0.5)";
}

with(milonic=new menuname("Left Menu")){
style=menuStyle;
alwaysvisible=1;
followscroll=1;
screenposition="left;middle";
orientation="vertical";
aI("text=Jump;showmenu=Aspects;status=Jump to a specific part of the Page");
}

with(milonic=new menuname("Aspects")){
style=menuStyle2;
screenposition="middle";
aI("text=Introduction;url=/aspects.php#introduction;");
aI("text=Conjunction;url=/aspects.php#conjunction;");
aI("text=Opposition;url=/aspects.php#opposition;");
}

drawMenus();


Poster: Ruth
Dated: Friday September 10 2004 - 13:33:28 BST

I see what you did, it seems to work, looks nice. But, I don't know that it works in all browsers or OS. Setting that screenposition seems to prevent the suboffset function from working when followscroll is also set in the main. I don't know if you could get a function to do what you want, there is a section on methods and functions, and it has something about spos setting position, but I really don't understand how to do any of it nor if it would be useful for what you want. http://www.milonic.com/menu_methods.php

Ruth


Poster: dklugmann
Dated: Friday September 10 2004 - 15:28:39 BST

Thanks Ruth

Do you think anyone else would know how to get a submenu to appear out in the middle and not downwards from a parent menu ? Perhaps I should raise another question in a different forum ?

Cheers

David