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

Moveing a menu after it has been rendered?


Poster: jptilkes
Dated: Tuesday February 24 2004 - 19:43:00 GMT

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.


Poster: John
Dated: Tuesday February 24 2004 - 20:35:17 GMT

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.


Poster: jptilkes
Dated: Tuesday February 24 2004 - 20:51:13 GMT

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?


Poster: kevin3442
Dated: Tuesday February 24 2004 - 21:16:52 GMT

You have
Code:
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:
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


Poster: jptilkes
Dated: Tuesday February 24 2004 - 21:25:27 GMT

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.