dropdowns not perfectly aligned?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
shooterhugh
Beginner
Beginner
Posts: 1
Joined: Fri Nov 05, 2004 9:12 am

dropdowns not perfectly aligned?

Post by shooterhugh »

I'm using the menu nested inside a table and would like my dropdowns to line up with my menu borders. But it seems to be off: 1pixel up and left in IE and 1pixel right in Firefox.

This occurs even in your example:
http://milonic.com/menusample9.php

Is this by design? Is there anything I can do to remove the offsets?

Any help is greatly appreciated.[/url]
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: dropdowns not perfectly aligned?

Post by kevin3442 »

Hi,
shooterhugh wrote:...Is there anything I can do to remove the offsets?
You can add your own offsets to the first-level submenus. The first-level submenus are not affected by _subOffsetTop and _subOffsetLeft (globals set at the top of menu_data.js). However, you can create your own using the regular top and left properties.

Define two new globals at the top of menu_data.js, like so:

Code: Select all

var sub1TopOffset = 1;
var sub1LeftOffset = 2;
Values are in px. Positive values offset to the right, negative to the left.

Now suppose you have a first-leve submenu named "Products" and you want to move it a little. The definition would be along these lines:

Code: Select all

with(milonic=new menuname("Products")){
top = "offset=" + sub1TopOffset;
left = "offset=" + sub1LeftOffset;
style=menuStyle;
overflow="scroll";
aI("text=Product 1;url=product1/html;");
aI("text=Product 1;url=product1/html;");
...
}
Add the same exact top= and left= code for every first-level submenu. Then you can adjust the values assigned to sub1TopOffset and sub1LeftOffset to adjust the standard offsets for each first-level submenu.

Hope that helps,

Kevin
Post Reply