Scrolling a div

D

dunerunner

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
 
D

David Mark

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.
 
D

dunerunner

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
 
D

David Mark

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top