Multiple "subOffset" values?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bparrish
Beginner
Beginner
Posts: 4
Joined: Fri Dec 03, 2004 6:01 pm

Multiple "subOffset" values?

Post by bparrish »

Hi there! Brand new to Milonic menus, so I apologize if this is a FAQ, or even just a stupid question:

Is there a way to have one layer of submenus have different _subOffset values from another in the same menu? For example, if I wanted the set of menus right underneath the main menu line up flush with the main menu, but any submenus IN those submenus, I want to overlap, can I do that?

I didn't see anything in the reference for an "offset" menu parameter, but perhaps I missed it.

Thanks for the help.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

If you are using a horizontal menu, the first level submenus will align immediately under the main menu and then the suboffsets you set will refer to the next level menus that drop off the first sub level. If you are using a vertical menu you can set the _subOffsets to what you want the 1st sub level to be coming off that menu, then you can set the top and left positions of the next levels by using the following code in the menu itself right after the style=

Code: Select all

style=whateverstyle;
top="offset=Xpx";
left="offset=Xpx";
THe X of course will be what you want the submenu offset to be. I just tried that with the downloaded sample and it works in Netscape 6.1, 7.1, Opera 7.11, Firebird .07 and IE5.5

Ruth
kbourzikas
Beginner
Beginner
Posts: 2
Joined: Wed Dec 15, 2004 5:59 pm

offset first dropdown menu

Post by kbourzikas »

Hello.
I saw this post and I am trying to do something similar. I want to offset the first drop down dynamically so that it will change when the page is resized. What I am trying to do is create a variable with...

Code: Select all

var winRight = document.body.scrollWidth;
and place this in the left= winRight like this...

Code: Select all

with(milonic=new menuname("Connections")){
style=subStyle;
top=0;
left="winRight - 560";
aI("text=Message Center;url=/menusample1.php;");
aI("text=Address Book;url=/menusample2.php;");
}
Here's the problem, it works when it is first loaded but it doesn't refresh if the screen is resized. For example, it sets the left property to where the menu is first instantiated but if the browser is resized, the nav bar moves with the screen because it isn't set to one position but the drop down menus stay in the same place.

I also tried

Code: Select all

left="document.body.scrollWidth; - 560";
but doesn't seems to work at all. It doesn't seem to take the document.body.scrollWidth command and places it at the zero position.

Is there a way to dynamically refresh the location of the drop down menu without refreshing the page?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not sure I understand why you're trying to do that with the first drop down. It will change automatically when the page is refreshed/resized without any kind of function. If the main menu is say screenposition="center"; then if the page is resized the menu shifts to center of the new size and the drop downs follow it. If you have a test page and url it would be more helpful to see what it is you want to do. Without understanding what it is, perhaps you need some function that says something like on resize reload the page again?

Ruth
kbourzikas
Beginner
Beginner
Posts: 2
Joined: Wed Dec 15, 2004 5:59 pm

Post by kbourzikas »

It's kind of hard to explain and my sample is on a secure network. What I want the menu to do is popup on a certain area below where the menu normally loads. The idea is that when a person click the menu it will almost act as a reminder on the page so that it is near a form in the bottom/middle of the page, kind of like an alert. Plus I could give them options or help with the buttons. But because it's html and moves when the page is resized, i want the menu to do the same.

I have a function that is almost what you said. On resize, change this variable (winRight) to the width of the window minus the offset (winRight - 560). It's just that I can't refresh the page because the information on the form will be deleted. And instead of dealing with forms and submit, I could help them. I will try to set up an example for you to see.

So instead of reloading the page, I thought I would try to change the menu variables left and top on-the-fly. Are the menus in Milonic V 5.63 (this is what I am using) generated once when the page is loaded and can't be changed?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

The example would really help. I am understanding your explanation but not really getting what's happening or not happening. Sorry.

Ruth
Post Reply