By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,799 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,799 IT Pros & Developers. It's quick & easy.

Div Follows page vertical scrollBar

P: 25
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.
Jan 31 '07 #1
Share this Question
Share on Google+
5 Replies

b1randon
Expert 100+
P: 171
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
Jan 31 '07 #2

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

How did you find it?
Feb 1 '07 #3

P: 25
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?
Feb 1 '07 #4

P: 25
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. }
Feb 1 '07 #5

acoder
Expert Mod 15k+
P: 16,027
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.
Feb 1 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.