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:04
dropdowns not perfectly aligned?
Poster: shooterhugh
Dated: Friday November 5 2004 - 8:18:13 GMT
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://www.milonic.com/menusample9.php
Is this by design? Is there anything I can do to remove the offsets?
Any help is greatly appreciated.[/url]
Re: dropdowns not perfectly aligned?
Poster: kevin3442
Dated: Friday November 5 2004 - 22:08:28 GMT
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:
var sub1TopOffset = 1;
var sub1LeftOffset = 2;
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:
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;");
...
}
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