Thursday, April 28, 2011

how to tell when scroll bar is at bottom of an asp.net multiline text box

Hello,

I am working on an asp.net page and I have a multiline text box that displays some text. I want the user to have to scroll all the way to the bottom before I display a checkbox for them to continue. My question is how can you tell if the scroll bar is at the bottom?

From stackoverflow
  • By using javascript:

    in Internet Explorer: document.body.scrollLeft document.body.scrollTop

    in Netscape: window.pageXOffset window.pageYOffset

    jumbojs : that'll give me the dimensions but what do I compare to so I know it's the bottom?
    Kolten : from the top of my head: if (theTextBox.scrollTop == theTextBox.scrollHeight) {theCheckBox.visible = true;}

0 comments:

Post a Comment