Div Follows page vertical scrollBar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • obarash
    New Member
    • Jan 2007
    • 25

    Div Follows page vertical scrollBar

    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
    Recognized Expert New Member
    • Dec 2006
    • 171

    #2
    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

    Comment

    • obarash
      New Member
      • Jan 2007
      • 25

      #3
      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?

      Comment

      • obarash
        New Member
        • Jan 2007
        • 25

        #4
        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?

        Comment

        • obarash
          New Member
          • Jan 2007
          • 25

          #5
          I solved the problem

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

          Code:
          function findPos(obj){
              var curleft = curtop = 0;
              if (obj.offsetParent){
                  curleft = obj.offsetLeft;
                  curtop = obj.offsetTop;
                  while (obj = obj.offsetParent){
                      curleft += obj.offsetLeft;
                      curtop += obj.offsetTop;
                  }
              }
              return [curleft,curtop];
          }
          Last edited by acoder; Feb 1 '07, 11:07 AM. Reason: Code in tags

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            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.

            Comment

            Working...