Connecting Tech Pros Worldwide Help | Site Map

Manually setting the position of a scrollbar

  #1  
Old June 26th, 2009, 12:35 AM
Newbie
 
Join Date: May 2009
Posts: 18
Hey, I've got an HTML page with several span tags, each of which will gain text as my script runs. I've got them fixed in a box, and overflow set to "auto" so that they'll have a scrollbar when the text can no longer fit.

\I want the scroll bar to move down as far as it can go each time text is added, so that it "follows" the text. My problem is that I'm not sure how to do this. Is there some easy way with Javascript to set the position of the scrollbar?
  #2  
Old June 26th, 2009, 12:31 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,517
Provided Answers: 12

re: Manually setting the position of a scrollbar


Yes, use scrollTop.
  #3  
Old June 26th, 2009, 08:27 PM
Newbie
 
Join Date: May 2009
Posts: 18

re: Manually setting the position of a scrollbar


Awesome, it works great now. Thanks.
  #4  
Old June 28th, 2009, 10:40 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,517
Provided Answers: 12

re: Manually setting the position of a scrollbar


You're welcome :)
Reply

Tags
bar, javascript, scroll, scrollbar


Similar Threads
Thread Thread Starter Forum Replies Last Post
html/span/css navbar hell David Housman answers 5 February 10th, 2007 02:05 PM
Programmatically Scrolling a Listview SlantyOD answers 1 November 15th, 2005 05:40 PM