Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    check if vertical scrollbar is present

    Is there a way to check if a vertical scrollbar is present?
    The purpose is to place automatically a top-of-page link if the scrollbar is present - if no scrollbar is present no link will be placed.

    Tx

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That works in IE (not tested in NS):

    Code:
    <script>
    pg=document.body;
    if (pg.scrollHeight>pg.clientHeight) document.write('top of page'.link('#'))
    </script>
    Don't resist to assimilation. Billions of Borgs can't be wrong!


  •  

    Posting Permissions

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