Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:25

Relative Positioning Within a Centered div (solved)


Poster: sdwespi
Dated: Monday December 17 2007 - 17:59:01 GMT

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:
   
<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.]

Re: Relative Positioning Within a Centered div (solved)


Poster: sdwespi
Dated: Tuesday December 18 2007 - 15:45:04 GMT

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