position of followscroll

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dbonneville
Advanced
Advanced
Posts: 22
Joined: Wed May 05, 2004 8:33 pm

position of followscroll

Post by dbonneville »

It appears that the menu I'm using won't allow the menu to sit at a true 0 position on the screen. It's about 2 px down from the top. How do I get this to be trully flush at the top? I can see parts of my page whizzing by when I scroll down in the little gap. Is there an invisible border on it or something? I'm working with the sample provided for win98 style menus, sitting on an almost empty webpage. The script to draw the menus is before the body tag on the page, as the examples suggest, so nothing is in the way of it that I can tell.

Here is the code for the menu:

Code: Select all

with(windows98style=new mm_style()){
onbgcolor="#00007F";
oncolor="#FFFFFF";
offbgcolor="#BFBFBF";
offcolor="#000000";
bordercolor="#BFBFBF";
borderstyle="raised";
borderwidth=2;
separatorsize="2";
padding=4;
fontsize="8pt";
fontfamily="arial, helvetica, sans";
high3dcolor="#eeeeee";
low3dcolor="#7F7F7F";
swap3d="1";
subimage="arrow.gif";
subimageposition="right";
}


with(milonic=new menuname("Main Menu")){
style=windows98style;
top=0;
left=0;
alwaysvisible=1;
orientation="horizontal";
followscroll="1";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=Samples;");
aI("text=Milonic;showmenu=Milonic;");
aI("text=Partners;showmenu=Partners;");
aI("text=Links;showmenu=Links;");
aI("text=My Milonic;showmenu=My Milonic;");
}
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I believe it has to do with the margins the browser puts in, which seem to be different in each browser :lol: I put a css style code in the head for 0px margin. But, and be aware this will not validate, but browsers seem to read it, in the body tag I put leftMargin="0" topMargin="0" MARGINHEIGHT="0" MARGINWIDTH="0". That will eliminate any margin at the top or left.
Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

It's probably because you have followscroll=1;. That means the top of the menu will sit at 1px from the top of the browser window once scolling begins (followscroll is not a boolean). That would leave a 1px gap. To get no gap, you need followscrolling to happen at 0px from the top. Problem is that if you set followscroll=0; then menu scrolling doesn't happen. But there is another way to set it at 0. See this post for details on how.

Hope that helps,

Kevin
Post Reply