Scrolling a div

Discussion in 'Javascript' started by dunerunner, Oct 26, 2007.

  1. dunerunner

    dunerunner Guest

    We have a table within a div whose overflow-x is scroll. It is a long
    table, so the width of the div is 800px, giving us a scrollbar at the
    bottom. When users tab from cell to cell, the cells that contain
    select elements that were out of the visible viewing area acquire the
    focus, but they are still visually off the scrolling region. So, the
    user has to manually move the scrollbar to bring the element into
    view.

    Is there a way we can manipulate the scrollbar (or whatever) to move
    that entire element into view?


    Thanks,

    Tim
     
    dunerunner, Oct 26, 2007
    #1
    1. Advertising

  2. dunerunner

    David Mark Guest

    On Oct 26, 8:00 am, dunerunner <> wrote:
    > We have a table within a div whose overflow-x is scroll. It is a long
    > table, so the width of the div is 800px, giving us a scrollbar at the
    > bottom. When users tab from cell to cell, the cells that contain
    > select elements that were out of the visible viewing area acquire the
    > focus, but they are still visually off the scrolling region. So, the
    > user has to manually move the scrollbar to bring the element into
    > view.
    >
    > Is there a way we can manipulate the scrollbar (or whatever) to move
    > that entire element into view?


    You can use the scrollTop and scrollLeft properties of the DIV to
    change the scroll position.
     
    David Mark, Oct 26, 2007
    #2
    1. Advertising

  3. dunerunner

    dunerunner Guest

    On Oct 26, 8:22 am, David Mark <> wrote:
    > On Oct 26, 8:00 am, dunerunner <> wrote:
    >
    > > We have a table within a div whose overflow-x is scroll. It is a long
    > > table, so the width of the div is 800px, giving us a scrollbar at the
    > > bottom. When users tab from cell to cell, the cells that contain
    > > select elements that were out of the visible viewing area acquire the
    > > focus, but they are still visually off the scrolling region. So, the
    > > user has to manually move the scrollbar to bring the element into
    > > view.

    >
    > > Is there a way we can manipulate the scrollbar (or whatever) to move
    > > that entire element into view?

    >
    > You can use the scrollTop and scrollLeft properties of the DIV to
    > change the scroll position.


    OK, I've been able to use scrollLeft, but I now need to know the
    position of my scrollbar in the div. I can't seem to find any
    property for that. I am using scrollWidth and clientWidth to
    determine the sizes of the scrolling area and elements, but I can't
    find any references for them. So, is there a property that will
    indicate my scrollbar position?


    Thanks,

    Tim
     
    dunerunner, Oct 28, 2007
    #3
  4. dunerunner

    David Mark Guest

    On Oct 28, 2:12 pm, dunerunner <> wrote:
    > On Oct 26, 8:22 am, David Mark <> wrote:
    >
    > > On Oct 26, 8:00 am, dunerunner <> wrote:

    >
    > > > We have a table within a div whose overflow-x is scroll. It is a long
    > > > table, so the width of the div is 800px, giving us a scrollbar at the
    > > > bottom. When users tab from cell to cell, the cells that contain
    > > > select elements that were out of the visible viewing area acquire the
    > > > focus, but they are still visually off the scrolling region. So, the
    > > > user has to manually move the scrollbar to bring the element into
    > > > view.

    >
    > > > Is there a way we can manipulate the scrollbar (or whatever) to move
    > > > that entire element into view?

    >
    > > You can use the scrollTop and scrollLeft properties of the DIV to
    > > change the scroll position.

    >
    > OK, I've been able to use scrollLeft, but I now need to know the
    > position of my scrollbar in the div. I can't seem to find any
    > property for that. I am using scrollWidth and clientWidth to
    > determine the sizes of the scrolling area and elements, but I can't
    > find any references for them. So, is there a property that will
    > indicate my scrollbar position?


    Yes. The scrollLeft property.
     
    David Mark, Oct 28, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=

    datagrid in a div for scrolling question

    =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=, Aug 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    572
    jasonkester
    Aug 26, 2005
  2. stan
    Replies:
    0
    Views:
    470
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    812
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    242
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    361
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page