Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Scrolling a div

Reply
Thread Tools

Scrolling a div

 
 
dunerunner
Guest
Posts: n/a
 
      10-26-2007
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

 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      10-26-2007
On Oct 26, 8:00 am, dunerunner <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
 
dunerunner
Guest
Posts: n/a
 
      10-28-2007
On Oct 26, 8:22 am, David Mark <(E-Mail Removed)> wrote:
> On Oct 26, 8:00 am, dunerunner <(E-Mail Removed)> 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

 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      10-28-2007
On Oct 28, 2:12 pm, dunerunner <(E-Mail Removed)> wrote:
> On Oct 26, 8:22 am, David Mark <(E-Mail Removed)> wrote:
>
> > On Oct 26, 8:00 am, dunerunner <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
smooth scrolling & auto scrolling sillyputty Firefox 1 08-24-2007 02:10 AM
scrolling within div triggered by jump:restrict to div stan HTML 0 01-18-2007 03:07 AM
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments