How to get the menu centered.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
WeeR
Beginner
Beginner
Posts: 3
Joined: Thu Mar 01, 2007 2:44 pm

How to get the menu centered.

Post by WeeR »

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://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!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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: Select all

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: Select all

<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: Select all

<TD class=menu_bg style="WHITE-SPACE: pre" vAlign=center 
                align=middle>
call the main_embed.js file

Code: Select all

<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
Post Reply