Pop Up Menu Positioning

C

Chris

Hello!

I'm using java to add pop up menus to my web site. Im pretty much in the
clear, but I am having trouble getting the pop up menu to appear where I want
it to. The problem is my pop up menu appears directly where I hover my mouse
on the link, instead of slightly off to the side where I want it to appear
each time. I'm using the following code:

..menuskin{
position:absolute;
width:165px;
background-color:#B5CDE6;
border:1px solid black;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
visibility:hidden;
}

I've tried specifying coordinates but to no avail, the pop up just appears
directly at the top of the page if I do that.

How can I make the popup display in the same spot each time, no matter what
point of the link the mouse hovers over?

Thanks for your help!!
 
R

Ronx

Set the top and left coordinates of the menu layer to where you want the
menu to appear.

Example:

..menuskin{
position:absolute;
top: 150px;
left: 250px;
width:165px;
background-color:#B5CDE6;
border:1px solid black;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
visibility:hidden;
}
This positions the menu 150px below, and 250px to the right of the top left
corner of the page, as long as the layer is not contained by any other block
level element.
 
C

Chris

Thanks that did help, I was able to move the box to the desired position in
design view, but when I preview the box still hops around to wherever I place
my mouse at on the link. Really aggrvating....any idea what could be wrong?
Yes I did save and all that good stuff =)

Thanks!
 
R

Ronx

The code being used is beyond my knowledge of JavaScript, but it seems to me
that code in function showmenu() from
menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth :
menuobj.document.gui.document.width

onwards is adjusting the position of the popup according to the position of
the mouse.
Try commenting this section out and see what happens.

You have not defined any styles for class menuitems, not that that will make
a difference to the problem in hand.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top