Position of menu in relation to a div

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dhnriverside
Beginner
Beginner
Posts: 5
Joined: Wed Aug 31, 2005 9:46 am

Position of menu in relation to a div

Post by dhnriverside »

Hi guys

I'm currently working to implement the Milonic menu in an intranet application I'm building.

I've picked the Context Menu sample (probably the wrong one to be fair). I actually wanted a menu when you click a div. Anyway, I've got it to only work on that div, and on the left mouse button, but I'm struggling with the positioning.

I've got the left and itemwidth properties sorted, but I want the height to be the top (so mydiv.top) minus the height of the menus?

Unfortunately I can't just work it out, as I'm not sure how far down the div will be!

Any ideas?!

Cheers


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

Post by John »

Typically the menu does not like being cooped up in a div. Strange and unwanted things happen...

Got a URL (as requested)?
John
dhnriverside
Beginner
Beginner
Posts: 5
Joined: Wed Aug 31, 2005 9:46 am

Post by dhnriverside »

No URL, it's an intranet site, sorry.

I'm not trying to put the menu in the div. Basically the idea is the div is setup to look like a button at the end of a page, and when u click it, i want the menu to appear on top of the button, but of course the menu is larger than the button.

So all I'm trying to do is set the left/top properties of the menu so that I can position it.

so

with(menu) {
left = 2; //aligns with button
top = div.top - height of menu

How do / can I use document.feedback with the top property of the menu, it just seems to ignore it.

Cheers


Dan
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Since you're on an intranet, could you post the page code here and show us how you have the menu set up? That's for me, I'm not good with visualization, but usually I can figure something if I have the page.

Not being sure what you are doing, have you considered using a pop up menu? You can position those based on an image and set offsets from the image allowing you to position it to open exactly where you want it.

I don't know if these will help.

Methods and Functions info

Using the pop menu function positioned by images
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

:oops: On that link for methods and functions, you are looking for the pop function down toward the bottom which talks about positioning the menu when using that pop function.

Ruth
Post Reply