Relative Positioning Within a Centered div (solved)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
sdwespi
Beginner
Beginner
Posts: 2
Joined: Mon Dec 17, 2007 6:30 pm

Relative Positioning Within a Centered div (solved)

Post by sdwespi »

Hello,

First of all, I love your drop down menu and I've been quite impressed with it's performance and flexibility so far.

I'm having a little trouble positioning the menu within a centered div tag. Obviously the menu itself is in a table cell, but if that table is within a div centered using "auto" for the left and right margins, the menu seems to add the distance between the beginning of the menu and the left side of the page and the left offset for it's position in the horizontal menu. This causes the sub menu to show up too far towards the right, depending on how wide the browser window is.

Here's an example using the sample menu. I've tried to strip the example down to emphasize the problem:

http://scottwespi.com/milonic/

The relevant css/html looks like this:

Code: Select all

	
<style>
#Container {
	width: 700px;
	margin-right: auto;
	margin-left: auto;
	position: relative;
}
body {
	margin: 0px;
	float: none;
}
#TopToc {
	height:32px;
}
</style>

...

<div id="Container">
	<div id="TopToc">       
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<script type="text/javascript">...</script>
				</td>
			</tr>
		</table>
	</div>
</div>
I'm sure someone must have run into this problem before, but I can't seem to find a solution - is there any way someone can point me to an existing thread, or an example that helps me solve this problem?

Thanks,

-Scott

[Note: I'm using a licensed version of the menu, but I've stripped the licensing information from the javascript for this example, since it's on a separate host.]
sdwespi
Beginner
Beginner
Posts: 2
Joined: Mon Dec 17, 2007 6:30 pm

Re: Relative Positioning Within a Centered div (solved)

Post by sdwespi »

I found the problem - I had to set buildAfterLoad to true.
Post Reply