Results 1 to 4 of 4

Thread: Tell location of scrollbars in textarea?

  1. #1
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Tell location of scrollbars in textarea?

    I've tried these properties of the textarea element:
    offsetHeight
    scrollHeight


    They effectively tell me when the text has overflowed where it causes there to be scrollbars in the textarea. However, I need to know the location of scrollbars themselves. How can I know where the scrollbar stands in its scrolling range? I have no idea if the user has scrolled halfway down the textarea, not scrolled at all, or when they start to scroll.

    How can i tell the location of the scrollbar (width or height) in a textarea?

    -thanks

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    There wouldn't be any JavaScript-style methods to gain such information. But you can do it manually with a Windows Based Program called Magnifier. If you have windows, search for Magnifier.exe and then open it. If you could open the Internet Explorer file of your little HTML file, you can use magnifier to see how many pixels accross the scrollbar there are, and even how far away from the left it is. It might not be the best way, but it is the only way I know of doing it.

    -magicyte

  3. The Following User Says Thank You to magicyte For This Useful Post:

    glz (06-23-2008)

  4. #3
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    returns the distance in pixels from the top of the element to the top of the viewing point: document.getElementById("textarea").scrollTop
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@ /\/\@|{
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  5. The Following User Says Thank You to Master_script_maker For This Useful Post:

    glz (06-23-2008)

  6. #4
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    thanks everyone... this is a great reference site for all of these methods as well:
    http://msdn.microsoft.com/en-us/libr...38(VS.85).aspx

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •