scrollTo only if horizontal scrollbar

Discussion in 'Javascript' started by anna, Apr 17, 2004.

  1. anna

    anna Guest

    How to tell if a horizontal scrollbar is present? I only want to use
    scrollTo if horizontal scrollbar is present.

    window.scrollbars.visibility doesn't specify which scrollbar is
    present, so it gives a false result if there is vertical scrollbar but
    not horizontal scrollbar.

    TIA,
    Anna
     
    anna, Apr 17, 2004
    #1
    1. Advertising

  2. anna

    anna Guest

    FOLLOWUP


    if (navigator.appName.indexOf("Netscape") != -1 &&
    parseFloat(navigator.appVersion) < 5 ) {
    if (document.width > window.innerWidth) {
    document.write('<a
    href="javascript:window.scrollTo(1000,window.pageYOffset)"><img
    src="/icons/redarrow.gif" border=0 alt="Scroll right"><img
    src="/icons/redarrow.gif" border=0 alt="Scroll right"></a>');
    }
    } else {
    if (document.body.scrollWidth > document.body.clientWidth) {
    document.write('<a
    href="javascript:window.scrollTo(1000,document.body.scrollTop)"><img
    src="/icons/redarrow.gif" border=0 alt="Scroll right"><img
    src="/icons/redarrow.gif" border=0 alt="Scroll right"></a>');
    }
    }
     
    anna, Apr 27, 2004
    #2
    1. Advertising

  3. anna wrote:

    > [nonsense again]


    See <news:>


    PointedEars
     
    Thomas 'PointedEars' Lahn, Apr 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Kistler

    automated scrollTo() problem

    Bob Kistler, Sep 12, 2003, in forum: Javascript
    Replies:
    1
    Views:
    101
    asdf asdf
    Sep 13, 2003
  2. Simon Wigzell

    scrollTo doesn't work

    Simon Wigzell, Feb 15, 2004, in forum: Javascript
    Replies:
    0
    Views:
    121
    Simon Wigzell
    Feb 15, 2004
  3. z

    crazy scrollTo

    z, Apr 6, 2004, in forum: Javascript
    Replies:
    0
    Views:
    98
  4. Replies:
    5
    Views:
    92
  5. window.scrollTo

    , Apr 13, 2007, in forum: Javascript
    Replies:
    0
    Views:
    69
Loading...

Share This Page