Menu not always centered

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
aptisman
Beginner
Beginner
Posts: 5
Joined: Mon Apr 19, 2004 6:43 pm
Location: Peterhead, Scotland

Menu not always centered

Post by aptisman »

My menu is correctly positioned in IE6 but there seems to be a problem with it in Opera and Firefox 0.8.

If the page is not in the cache the menu is off-set to the left about an inch when it should be centered. On a reload or move to another page it appears correctly.

The URL is http://www.peterhead-methodist.org.uk/ and the menu code is as follows:-

_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=0 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset



with(menuStyle=new mm_style()){
onbgcolor="#ffdce7";
oncolor="#007900";
offbgcolor="#ffecea";
offcolor="#b05010";
bordercolor="#296488";
borderstyle="solid";
borderwidth=2;
separatorcolor="#2D729D";
separatorsize="1";
padding="4";
fontsize="75%";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
fontweight="bold";
pagecolor="black";
pagebgcolor="#91ccD7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="arrow.gif";
subimageheight="5";
subimagewidth="5";
subimagepadding="0 2 0 0";
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=20;
screenposition="center";
alwaysvisible=1;
followscroll="1";
orientation="horizontal";
aI("text=Home;url=http://www.peterhead-methodist.org.uk/;status=Back To Home Page;");
aI("text=About Us;showmenu=About Us;");
aI("text=How to Reach Us;showmenu=How to Reach Us;");
aI("text=Links;showmenu=Links;");
aI("text=Resources;showmenu=Resources;");
aI("text=Sunday Services;showmenu=Sunday Services;");
aI("text=Weekday Activities;showmenu=Weekday Activities;");
}

with(milonic=new menuname("About Us")){
style=menuStyle;
overflow="scroll";
aI("text=Care Line;url=http://www.peterhead-methodist.org.uk/p ... tatus=Care Line;");
aI("text=Contact Us;url=http://www.peterhead-methodist.org.uk/c ... us=Contact Us;");
aI("text=Guest Book - Read;url=http://www.peterhead-methodist.org.uk/g ... tatus=Read Guest Book;");
aI("text=Guest Book - Sign;url=http://www.peterhead-methodist.org.uk/i ... tatus=Sign Guest Book;");
aI("text=History of our church;url=http://www.peterhead-methodist.org.uk/h ... us=History of our church;");
aI("text=Magazine;url=http://www.peterhead-methodist.org.uk/n ... s=Magazine;");
aI("text=Methodist Beliefs;url=http://www.peterhead-methodist.org.uk/b ... =Methodist Beliefs;");
aI("text=MFV Master of the Sea;url=http://www.peterhead-methodist.org.uk/m ... status=MFV Master of the Sea;");
aI("text=Mission Statement;url=http://www.peterhead-methodist.org.uk/m ... us=Mission Statement;");
aI("text=North of Scotland Mission Circuit;url=http://www.peterhead-methodist.org.uk/c ... atus=North of Scotland Mission Circuit;");
aI("text=Refurbishment;url=http://www.peterhead-methodist.org.uk/r ... urbishment;");
aI("text=Testimonies;url=http://www.peterhead-methodist.org.uk/t ... estimonies;");
}

with(milonic=new menuname("How to Reach Us")){
style=menuStyle;
aI("text=Contact Us;url=http://www.peterhead-methodist.org.uk/c ... us=Contact Us;");
aI("text=Report a Dead Link;url=http://www.peterhead-methodist.org.uk/c ... tus=Report a Dead Link;");
aI("text=Travel Directions;url=http://www.peterhead-methodist.org.uk/h ... tus=Travel Directions;");
}

with(milonic=new menuname("Links")){
style=menuStyle;
overflow="scroll";
aI("text=Peterhead Links;url=http://www.peterhead-methodist.org.uk/p ... =Peterhead Links;");
aI("text=Other Links;url=http://www.peterhead-methodist.org.uk/o ... atus=Other Links;");
}

with(milonic=new menuname("Resources")){
style=menuStyle;
overflow="scroll";
aI("text=23rd Psalm in Scottish;url=http://www.peterhead-methodist.org.uk/d ... tatus=23rd Psalm;");
aI("text=Alternative Lord's Prayer;url=http://www.peterhead-methodist.org.uk/l ... lternative Lord's Prayer;");
aI("text=Christmas;showmenu=Sub Menu 5;status=Christmas;");
aI("text=Easter;showmenu=Sub Menu 1;status=Easter;");
aI("text=Food Safety;url=http://www.peterhead-methodist.org.uk/f ... tatus=Food Safety;");
aI("text=God's Armour;url=http://www.peterhead-methodist.org.uk/a ... atus=God's Armour;");
aI("text=Help;showmenu=Sub Menu 2;status=Help;");
aI("text=Hymns;url=http://www.peterhead-methodist.org.uk/m ... atus=Hymns;");
aI("text=Inspiration;showmenu=Sub Menu 3;status=Inspiration;");
aI("text=Pentecost;url=http://www.peterhead-methodist.org.uk/p ... =Pentecost;");
aI("text=People;url=http://www.peterhead-methodist.org.uk/p ... tus=People;");
aI("text=Topical Issues;showmenu=Sub Menu 4;status=Topical Issues;");
}

with(milonic=new menuname("Sunday Services")){
style=menuStyle;
aI("text=Preacher Details;url=http://www.peterhead-methodist.org.uk/p ... s=Preacher Details;");
aI("text=Services;url=http://www.peterhead-methodist.org.uk/s ... s=Services;");
}

with(milonic=new menuname("Weekday Activities")){
style=menuStyle;
aI("text=Alpha;url=http://www.peterhead-methodist.org.uk/a ... atus=Alpha;");
aI("text=Boys' Brigade;url=http://www.peterhead-methodist.org.uk/b ... tatus=Boys' Brigade;");
aI("text='Open Doorie';url=http://www.peterhead-methodist.org.uk/o ... atus='Open Doorie';");
aI("text=Youth Church;url=http://www.peterhead-methodist.org.uk/y ... atus=Youth Church;");
aI("text=Other Groups;url=http://www.peterhead-methodist.org.uk/a ... atus=Other Groups;");
}

with(milonic=new menuname("Sub Menu 1")){
style=menuStyle;
overflow="scroll";
aI("text=The Crucifixion;url=http://www.peterhead-methodist.org.uk/e ... status=The Crucifixion;");
aI("text=Women at the Tomb;url=http://www.peterhead-methodist.org.uk/e ... atus=Women at the Tomb;");
aI("text=There is no body!;url=http://www.peterhead-methodist.org.uk/e ... atus=There is no body!;");
aI("text=Jesus Appears;url=http://www.peterhead-methodist.org.uk/e ... atus=Jesus Appears;");
}

with(milonic=new menuname("Sub Menu 2")){
style=menuStyle;
overflow="scroll";
aI("text=Care Line;url=http://www.peterhead-methodist.org.uk/p ... tatus=Care Line;");
aI("text=Don't Fret;url=http://www.peterhead-methodist.org.uk/h ... atus=Don't Fret;");
aI("text=Don't Worry;url=http://www.peterhead-methodist.org.uk/h ... atus=Don't Worry;");
aI("text=How are you feeling?;url=http://www.peterhead-methodist.org.uk/h ... tatus=THow are you feeling?;");
aI("text=Make Peace;url=http://www.peterhead-methodist.org.uk/h ... tatus=Make Peace;");
}

with(milonic=new menuname("Sub Menu 3")){
style=menuStyle;
overflow="scroll";
aI("text=Be a servant;url=http://www.peterhead-methodist.org.uk/i ... ;status=be a servant;");
aI("text=Forgiving Attitude;url=http://www.peterhead-methodist.org.uk/i ... =Forgiving Attitude;");
aI("text=Moaning People;url=http://www.peterhead-methodist.org.uk/i ... us=Moaning People");
}

with(milonic=new menuname("Sub Menu 4")){
style=menuStyle;
overflow="scroll";
aI("text=Are you going to heaven?;url=http://www.peterhead-methodist.org.uk/s ... status=Are you going to heaven?;");
aI("text=Hallowe'en;url=http://www.peterhead-methodist.org.uk/h ... Hallowe'en;");
aI("text=Homes and Gardens;url=http://www.peterhead-methodist.org.uk/h ... atus=Homes and Gardens;");
aI("text=Jubilee Plus;url=http://www.peterhead-methodist.org.uk/j ... us=Jubilee Plus;");
}

with(milonic=new menuname("Sub Menu 5")){
style=menuStyle;
overflow="scroll";
aI("text=A Journey;url=http://www.peterhead-methodist.org.uk/t ... m;status=A Journey;");
aI("text=St Nicholas;url=http://www.peterhead-methodist.org.uk/c ... ;status=St Nicholas;");
}

with(milonic=new menuname("Sub Menu 6")){
style=menuStyle;
overflow="scroll";
aI("text=Travel Directions;url=http://www.peterhead-methodist.org.uk/h ... tus=Travel Directions;");
aI("text=Contact Us;url=http://www.peterhead-methodist.org.uk/c ... us=Contact Us;");}

drawMenus();

I would appreciate some help with this - I have searched for previous similar topics but not found anything which helps.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Where you have a digits only, don't use quotes eg.
subimageheight="5";
subimagewidth="5";

where you have screenposition="center";
try adding
menualign="center";

That was just a quick look, see if it helps.

maz
aptisman
Beginner
Beginner
Posts: 5
Joined: Mon Apr 19, 2004 6:43 pm
Location: Peterhead, Scotland

Post by aptisman »

Sadly it did not help.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

subimagepadding="0 2 0 0";

try subimagepadding="0px 2px 0px 0px";

Sorry I'm not seeing anything obvious.

maz
aptisman
Beginner
Beginner
Posts: 5
Joined: Mon Apr 19, 2004 6:43 pm
Location: Peterhead, Scotland

Post by aptisman »

Sorry, that has not helped either.

One thing I have noticed is that when the menu first appears it is very briefly without the arrow graphic and it is centered. It's when the graphic appears that it moves to the left.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

You still have a few numeric items in the _data file with "" around them. Probably not the problem, but they aren't necessary.

Also, I just looked at the site with Opera 7.23 and did not see the problem you describe about the arrow graphic. Everything popped in instantly with no movement at all.

What version are you running? We've have a few instances lately of slightly down-level versions of Opera causing problems (e.g., 7.21, etc.).
John
aptisman
Beginner
Beginner
Posts: 5
Joined: Mon Apr 19, 2004 6:43 pm
Location: Peterhead, Scotland

Post by aptisman »

I have tried this menu in Opera 7.50b1 also Firefox 0.8 and I see the same problem.

Following on from what I said above about the shift when the graphic loads, to test this I have deleted all reference to the subimage and the problem has gone away, so it seems therein lies the problem!

If I tried a different image I wonder if that would help? In this connection are any of the other arrows etc you use in other menus downloadable separately?
Post Reply