Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Positioning JavaScript menus

Want them to line up properly at different resolutions


tortured virtue

4:42 pm on Jun 11, 2003 (gmt 0)

10+ Year Member

I am trying to create menus for my webpage, but I am having trouble getting the menus to display where I want them to. I got them nice and straight using pixel coordinates, but if someone viewing the page is set at a different resolution, the tables will line up off to one side. Is there a way to set a definite reference point for the menu to load, instead of having to use coordinates? Right now, the menus are opened when you move your mouse over certain images. Is there a way can just have them come up directly below the image? Thanks.


4:50 pm on Jun 11, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You could use relative positioning, but this can cause a bouncing of any content below the image.

Coordinates specified are relative to their parent element. That is, the co-ordinates for a div on a page are relative to the top left corner of the document. The 0,0 coordinaties for a div nested within a div are the top left corner of the parent layer.

The problem with pixel perfect designs is the heterogeneity of the resolutions used by your users. Designing something to appear 900px to the right of the left of the page will mean that a user, whose reolution is 800x600, will have to scroll horizontally to see it. This is very important to keep in mind when using pixel perfect designs.

tortured virtue

5:38 pm on Jun 11, 2003 (gmt 0)

10+ Year Member

I`m not sure I follow you. I`m not really trying to align the image; it`s the menu I want to align. When I use a div, it doesn`t reallt affect the menu, just the image. Here is the line of code for the image and menu:
<div align="left"> <img src="pre/company.jpg" alt="" width="133" height="20" onmouseover="showMenu(company, 200, 100);hideMenu(design);"></div>

Featured Threads

Hot Threads This Week

Hot Threads This Month