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:24
Menu no longer centered below heading
Poster: posword
Dated: Thursday January 10 2008 - 23:26:47 GMT
My menu used to be centered below the heading. I took out one item from the first level and now its flush right.
URL is http://www.peterwade.com/
YAM -- Yet Another Mystery !
Thanks,
Peter
Re: Menu no longer centered below heading
Poster: Ruth
Dated: Friday January 11 2008 - 0:09:26 GMT
Hi,
I can't figure out why it is doing that. Nothing I tested seems to tell me anything, however, I did find a fix so it will center.
The main menu coding would be this
Code:
with(milonic=new menuname("Main Menu")){
position="relative";
menuwidth="100%";
alwaysvisible=1;
orientation="horizontal";
separatorpadding=0;
style=menuStyle;
menualign="center";
position="relative";
menuwidth="100%";
alwaysvisible=1;
orientation="horizontal";
separatorpadding=0;
style=menuStyle;
menualign="center";
Then in that menu table, you'll need to put a table for the menu and the spacer image inside the cell where the menu is now
Code:
<!-- Menu Bar -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=1 bordercolor='red'>
<TBODY>
<TR vAlign=top align=center height=10>
<TD align="center"><table border=1 bordercolor='yellow' cellpadding=0 cellspacing=0>
<tr>
<td><IMG height=5 alt=space src="themes/2008/images/spacer.gif"
width=0>
<SCRIPT language=JavaScript src="themes/2008/milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=themes/2008/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=themes/2008/mmenudom.js><\/scr"+"ipt>");
</SCRIPT>
<SCRIPT language=JavaScript src="themes/2008/menu_data.js" type=text/javascript></SCRIPT></td>
</tr>
</table>
</TD></TR></TBODY></TABLE><!-- End of Menu Bar -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=1 bordercolor='red'>
<TBODY>
<TR vAlign=top align=center height=10>
<TD align="center"><table border=1 bordercolor='yellow' cellpadding=0 cellspacing=0>
<tr>
<td><IMG height=5 alt=space src="themes/2008/images/spacer.gif"
width=0>
<SCRIPT language=JavaScript src="themes/2008/milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=themes/2008/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=themes/2008/mmenudom.js><\/scr"+"ipt>");
</SCRIPT>
<SCRIPT language=JavaScript src="themes/2008/menu_data.js" type=text/javascript></SCRIPT></td>
</tr>
</table>
</TD></TR></TBODY></TABLE><!-- End of Menu Bar -->
That's all I can suggest since I don't know why it is doing what it is.
Ruth
Re: Menu no longer centered below heading
Poster: posword
Dated: Friday January 11 2008 - 1:25:43 GMT
Thanks, Ruth. That fixed it. It sure was a mystery why it suddenly went right!
Cheers,
Peter
Re: Menu no longer centered below heading
Poster: Ruth
Dated: Friday January 11 2008 - 4:40:15 GMT
Hi,
Well, I figured out what was wrong, just so you know what was happening. Something in the new menu version must have made the menu act 'correctly' as to how you have it coded. You had it set as menuwidth="650" and the table it is in, is inside a main table that is 750. So, it would be logical that the menu would have 50px on the left and 50px on the right of empty space. The problem is that although the menu is coded at 650, it is not 650 it is 700px or so, that is the items and each separator equal a 700px width. So, it seems what the menu did is read the 650 menuwidth and put the 50px on the left, but since it is really 700 px that made the menu 'shift' right and leave nothing on the right side since the actual width available between the 750 table width and the 700 actual menu width is only 50 px. I would suggest you leave the table as is, since that way even with new upgrades there shouldn't be that shift again.
Ruth
Re: Menu no longer centered below heading
Poster: posword
Dated: Friday January 11 2008 - 7:21:29 GMT
Thanks, Ruth. I can see what happened.
One further question: I've forgotten how to control the white space between each menu item on the horizontal level. It seems to be about 12px but I don't see that figure in the menu_data.js. I do see separatorsize=9.5; so maybe there is some padding somewhere.
Thanks.
Peter
Re: Menu no longer centered below heading
Poster: Ruth
Dated: Friday January 11 2008 - 8:07:32 GMT
Hi,
It's the separatorsize, and I only see the 9.5 between items in both IE, FF and Safari for the pc. You have no separatorpadding in the data file, and padding would not apply in the separator area. That would only be in the item between the text and the item's border.
Ruth
Re: Menu no longer centered below heading
Poster: posword
Dated: Friday January 11 2008 - 23:52:35 GMT
Thanks, Ruth.
Peter