Centering problems

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
aeonbb
Beginner
Beginner
Posts: 4
Joined: Tue Jan 15, 2008 10:32 am

Centering problems

Post by aeonbb »

Hello,

I have problem implementing the menu in IE.
The test page http://www.ockovanie.org/temp/povinne-ockovanie.html displays menu in the center in Firefox, bot not in IE.
Is it a bug or can it be remedied somehow?

Thanks,
Peter
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Centering problems

Post by Ruth »

Hi,

It looks the same for me in IE6 and FF at resolution 1024x768. What IE version, OS, and resolution shows the problem for you?

Ruth
aeonbb
Beginner
Beginner
Posts: 4
Joined: Tue Jan 15, 2008 10:32 am

Re: Centering problems

Post by aeonbb »

In IE 6 (Win XP, SP2), it looks like this http://www.ockovanie.org/temp/test.jpg
It is not centered but moves more to the right side.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Centering problems

Post by Ruth »

Hi,

Well, actually it is centered at 1024x768 resolution, since actually the menu centers based on page width and if you look at it, there a horizontal scroll bar at the bottom because the page seems to be something like 1090 px wide rather than the 1024. It's not possible for the menu to read the width of the browser, it has to go by page width

You can fix it, I don't actually know why it is doing that, but the solution is to

1. change your css body margin:0px; to MARGIN-TOP: 0px; MARGIN-RIGHT:0px MARGIN-BOTTOM:0px;MARGIN-LEFT:0px;

2. add

Code: Select all

<DIV id=wrapper>
and wrap all the content. That would go right after the <!-- End Menu --> and before the

Code: Select all

<DIV class=content>
Don't ask me why, because I have no idea. I just experiment with things. With that in there, the page no longer gets a bottom scroll bar and the menu looks centered, though it hasn't moved :)

Ruth
aeonbb
Beginner
Beginner
Posts: 4
Joined: Tue Jan 15, 2008 10:32 am

Re: Centering problems

Post by aeonbb »

Hi,

the menu is centered in Firefox under 1024x768 and also 1280x1024 (my default), so IT IS possible to determine the page width.
When used in IE under 1024x768, an unnecessary scrollbar appears, which is NOT there when I remove the menu or change the orientation to vertical, so I feel this is a bug.
When used in IE under 1280x1024, the scrollbar grows even larger, as if the page width was about 1600 pixels, so it suggests there is some miscalculation on the part of your component.

I am not willing to use workarounds, I need this to work as it is supposed to work.

Thanks,
Peter
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Centering problems

Post by Ruth »

I think you'll have to contact Milonic. I am a volunteer I do not work for Milonic. Since it seems to be an IE6 issue and css. I don't see how the menu is the problem, then again I am not a programmer, css or js person

Ruth
aeonbb
Beginner
Beginner
Posts: 4
Joined: Tue Jan 15, 2008 10:32 am

Re: Centering problems

Post by aeonbb »

Solved!

This is the reply from Milonic:

------
Please try changing the following main menu object:


with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
menuwidth="100%";
menualign="center";
orientation="horizontal";
style=menuStyle;
top=76;
aI("align=center;text=Home;url=http://milonic.com/;");
aI("align=center;showmenu=Milonic;text=Milonic;");
aI("align=center;showmenu=Partners;text=Partners;");
aI("align=center;showmenu=Links;text=Links;");
aI("align=center;showmenu=MyMilonic;text=MyMilonic;");
aI("align=center;text=Search;");
}



To This:


with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
orientation="horizontal";
style=menuStyle;
top=76;
screenposition="center"
aI("align=center;text=Home;url=http://milonic.com/;");
aI("align=center;showmenu=Milonic;text=Milonic;");
aI("align=center;showmenu=Partners;text=Partners;");
aI("align=center;showmenu=Links;text=Links;");
aI("align=center;showmenu=MyMilonic;text=MyMilonic;");
aI("align=center;text=Search;");
}



Setting the menu to 100% will cause problems with CSS, its better to remove it and apply a screenposition instead.

Hope this helps
Milonic Support
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Centering problems

Post by Ruth »

Hi,

Thanks for posting the solution here. It's great to have it available for other - and me :)

Ruth
Post Reply