Moveing a menu after it has been rendered?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jptilkes
Super Advanced
Super Advanced
Posts: 37
Joined: Thu Jun 13, 2002 3:01 pm

Moveing a menu after it has been rendered?

Post by jptilkes »

I am wondering if their is a way to have a menu positioned using screenposition and offsets until the position goes below a certain point?

Let me try to explain this, on this site: http://next.demandstream.net/test2.cfm I have positioned the "What's New" menu using offsets. (The page must be centered on the browser window to fullfill the designers requirments)

But if I resize the window smaller than the fixed size of the content, my menu starts "moving" up and to the left in relation to it's origional position.

So what I would like to do, is either, define a minimum position top and left or, as an alternative, be able to change the menu position after the fact (onResize, have a function that checks the menu position, them moves it if nessasary)

Thanks in advance.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

First, thank you for posting all your license numbers to the code. Most helpful.

I think the problem is that the menu is inside a <div>. It doesn't like that. There is positioning in the <div>, and additional positioning within the menu itself. Conflict.
John
jptilkes
Super Advanced
Super Advanced
Posts: 37
Joined: Thu Jun 13, 2002 3:01 pm

Post by jptilkes »

The menu is being displayed "over" a div, but all of the code itself is at the bottom of the page, outside of all of the divs. I am using screenposition and offsets to make the menu appear where it is so I don't "have" to put it inside the divs.

Do the divs still affect it?
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

You have

Code: Select all

screenposition="center,middle";
top="offset=13";
in your WhatsNewMenu ('center' and 'middle' should be separated by a semicolon by the way, like "center;middle"). When you narrow the browser window, a horizontal scrollbar appears at the bottom of the window, effectively raising the "middle" of the display area... the menu adjusts its vertical position accordingly. Also, by offsetting vertically from the "middle" you'll probably find that your menu ends up somewhere other than where you want it in different browsers, since the "middle" will differ across browsers.

Did you try setting top to a static position? I.e.,

Code: Select all

screenposition="center";
top=300;
Instead of 300, use a value that would place the menu where you want. This would be equivalent to offsetting from the top, and the top will not move when a horizontal scrollbar appears.

Let us know if that helps,

Kevin
jptilkes
Super Advanced
Super Advanced
Posts: 37
Joined: Thu Jun 13, 2002 3:01 pm

Post by jptilkes »

The problem with using the top as a static value is the distance from the top to the menu changes depending on the window size. (Content is centered horisontally and vertically in the window)

The postion is fine in all browsers I have tested as long as the window is large enough to fit all the content without scrollbars.

I was hoping that their would be a method to move the menu. I know the static position for when the browser is smaller than the content. But I don't know the static position when the browser is larger. i.e. I would like a "dynamic" position (the way is currently is setup) for larger browser windows and "static" postion for smaller windows.

I know I can determine the location of the menu, so I can determine when the menu is to far "up" and to the "left" of where I want it, but I don't know how to move it back.

I hope this is making sense.
Post Reply