Manually setting the position of a scrollbar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrjohn
    New Member
    • May 2009
    • 31

    Manually setting the position of a scrollbar

    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?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Yes, use scrollTop.

    Comment

    • mrjohn
      New Member
      • May 2009
      • 31

      #3
      Awesome, it works great now. Thanks.

      Comment

      Working...