Connecting Tech Pros Worldwide Help | Site Map

Div Follows page vertical scrollBar

Newbie
 
Join Date: Jan 2007
Posts: 25
#1: Jan 31 '07
After a very very long search in the internet and in this forum I
give up and asking you (the experts) a question.

I have a little from and I want it to "follow" the vertical scrollbar of the page.

I will ask a simple qustion ==>
How ?

I have no idea how to do this.

hope to get some answers and
thank you.
b1randon's Avatar
Expert
 
Join Date: Dec 2006
Location: Pittsburgh
Posts: 171
#2: Jan 31 '07

re: Div Follows page vertical scrollBar


Quote:

Originally Posted by obarash

After a very very long search in the internet and in this forum I
give up and asking you (the experts) a question.

I have a little from and I want it to "follow" the vertical scrollbar of the page.

I will ask a simple qustion ==>
How ?

I have no idea how to do this.

hope to get some answers and
thank you.

Here is a script that has that functionality: http://www.dynamicdrive.com/dynamicindex17/floatbar.htm
Newbie
 
Join Date: Jan 2007
Posts: 25
#3: Feb 1 '07

re: Div Follows page vertical scrollBar


Quote:

Originally Posted by b1randon

Here is a script that has that functionality: http://www.dynamicdrive.com/dynamicindex17/floatbar.htm

thank you.

How did you find it?
Newbie
 
Join Date: Jan 2007
Posts: 25
#4: Feb 1 '07

re: Div Follows page vertical scrollBar


The script in that website need a first X position and Yposition.

My problem is the X positoin,
because some of the people use 800X600 resolution and others use 1024X768.
Another problem is if the window is on fullscreen or not (because the site's align is to the center);

what can I do?
Newbie
 
Join Date: Jan 2007
Posts: 25
#5: Feb 1 '07

re: Div Follows page vertical scrollBar


I solved the problem

I'm using a function to find the positoin of the form in page

Expand|Select|Wrap|Line Numbers
  1. function findPos(obj){
  2.     var curleft = curtop = 0;
  3.     if (obj.offsetParent){
  4.         curleft = obj.offsetLeft;
  5.         curtop = obj.offsetTop;
  6.         while (obj = obj.offsetParent){
  7.             curleft += obj.offsetLeft;
  8.             curtop += obj.offsetTop;
  9.         }
  10.     }
  11.     return [curleft,curtop];
  12. }
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Feb 1 '07

re: Div Follows page vertical scrollBar


Glad you got your problem solved.

You asked how he found it. Probably by Googling, just put in the correct keywords and you should usually find what you want unless it's a very complex problem that no-one's attempted before.
Reply


Similar JavaScript / Ajax / DHTML bytes