followscrolling: how to align exactly to top ?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
pintronic
Beginner
Beginner
Posts: 7
Joined: Tue Aug 19, 2003 10:28 am

followscrolling: how to align exactly to top ?

Post by pintronic »

On the Milonic "Follow Scrolling" sample-page it is possible to change the top position value to "0". After the update-click the menu aligns exatly to the top when scrolling.
When I edit my menu-file to followscrolling=0 the menu doesn't scroll anymore.
What have I to edit, to get the same effect as on the Milonic sample.

Thanks in advance
-dp-
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

The followscroll variable is just a 0 or 1 setting. The help page says that it is for 'absolute' positioned menus'.
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
McTristan
Advanced
Advanced
Posts: 11
Joined: Thu Aug 14, 2003 4:16 pm

Post by McTristan »

@pintronic:

you may use the "top"-variable to specify the exact position of the menu and where it should stay while scrolling. Best thing is to use it in conjunction with "left" and/or "screenposition".
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Not sure about 'screenposition' (it's early here!), but this example might help. See http://www.west.asu.edu/sa/testsite/sl1.htm. That tiny 2-line white-on-maroon box near the upper left is the menu. Note the initial position is 209px down from the top of the window. As you scroll the menu then comes to rest just 1px from the top. The guts look like this...

Code: Select all

with(milonic=new menuname("mainmenu")){_c=1
top = 209;
left = 2;
style = mainStyle;
alwaysvisible = 1;
itemwidth=100;
followscroll = "1,100,2";
aI("text=ASU West;url=http://www.west.asu.edu/;title=ASU West home page;status=ASU West home page");
aI("text=Student Affairs;url=http://www.west.asu.edu/sa/;title=Student Affairs home page;status=Student Affairs home page");
}
The trick is followscroll. Here is the explanation from the boss...
The first parameter is the Top position that the menu will move at. Set it to 1 and the menu will scroll to pixel position 1. Set it to 100 and it will remain at pixel position 100. It's difficult to explain so might be an idea to try it out. Parameter 2 is the rate at which it scrolls and parameter 3 is the number of cycles per second, (or is it milliseconds, sieve like brain at the moment)
Using followscroll in this manner could allow for multiple scrolling menus on the same page, with each scrolling at a different rate and stop point. Not entirely sure why you'd want to dish out a headache like that, however...
John
pintronic
Beginner
Beginner
Posts: 7
Joined: Tue Aug 19, 2003 10:28 am

Post by pintronic »

:)
Cool, it works now.
My explanation of the problem was not exactly, but it works fine now and aligns to the top edge when scrolling after it starts at top=60
I didn't knew that the followscroll attribute can get more than one parameter. I use ' followscroll="0,1," .

@jgillet
thanks a lot

thanks to all who replied

bye

P.S. Does it work with v3.x too, and if yes how? It's not important, just interesting me.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

pintronic wrote:P.S. Does it work with v3.x too, and if yes how? It's not important, just interesting me.
Yes, but the implementation is a bit different.
John
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Thanks for the help, although mine works fine it doesn't make any sense.

The ruler says top 72, but I have top set to 85 & followscroll 14,0 to be accurate. I may have to readjust for newer browsers.

When screenposition is on its smoother. Makes me think if only I could put top position within screenposition.

Thinking allowed :|
maz
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Its already fixed.

Thanks Andy! :)
Post Reply