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

How to get the menu centered.


Poster: WeeR
Dated: Thursday March 1 2007 - 13:52:58 GMT

Hello!
First of all, thanks for a great product.
I'm having some problems with getting the menu fitted to my site.
My site is located at http://www.mabu.no/test .
It looks as it should in 1280x1024, but in all other res the menu is displayed wrong.
I'm pretty sure I have the same problem as descriped is http://www.milonic.com/forum/viewtopic.php?t=8612 post,but I can't figure out how to change my html code. (I'm really not an expert).
I would be great if you could help me out, and I would for sure buy your program as soon as I have it working.

Thanks in advance!


Poster: Ruth
Dated: Thursday March 1 2007 - 18:31:39 GMT

Hi,

The best way to do what you want is to position the menu relatively inside the table.

1. Open your menu_data.js file and cut out the main menu.
2. Paste that main menu into a separate file, put a drawMenus(); at the end of it and save it as main_embed.js


3.Open that main_embed file and make the main menu code the following, using position='relative'; and eliminating the top and left positions

Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
orientation="horizontal";
style=menuStyle;
position='relative';


You now have two files, the menu_data.js file which has the style and all the submenus in it and a drawMenus at the end, and a main file with only the main menu set as position relative and a drawMenus at the end of it also.

On your page, call all but the main_embed file the first thing after the body tag

Code:
<BODY>

<SCRIPT src="milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT src="mmenudom.js" type=text/javascript></SCRIPT>
<SCRIPT src="menu_data.js" type=text/javascript></SCRIPT>


Then in that table cell where you have the
Code:
<TD class=menu_bg style="WHITE-SPACE: pre" vAlign=center
                align=middle>
call the main_embed.js file

Code:
<TR>
                <TD class=menu_bg style="WHITE-SPACE: pre" vAlign=center
                align=middle><SCRIPT src="main_embed.js" type=text/javascript></SCRIPT></TD></TR>


That will keep the menu in that cell no matter what the resolution change, or font size change by users.

Ruth