Position of scrollbars

Discussion in 'HTML' started by TahoeJ, May 2, 2004.

  1. TahoeJ

    TahoeJ Guest

    I don't know is this is a javascript issue or a general html issue. When your page is too high or too wide to fit in the browser window, the browser adds a scrollbar(s) so you can navigate to the content that is off screen. My question is this: Is there some way (with or without javascript) to cause the browser to initially display oversize pages at their CENTER rather that at their top and left (which is the default)?

    Thanks in advance,
    John
     
    TahoeJ, May 2, 2004
    #1
    1. Advertising

  2. TahoeJ

    mscir Guest

    TahoeJ wrote:

    > I don't know is this is a javascript issue or a general html issue. When your page is too high or too wide to fit in the browser window, the browser adds a scrollbar(s) so you can navigate to the content that is off screen. My question is this: Is there some way (with or without javascript) to cause the browser to initially display oversize pages at their CENTER rather that at their top and left (which is the default)?
    >
    > Thanks in advance,
    > John


    code was found here:

    http://www.mozilla.org/docs/dom/domref/dom_window_ref105.html
    http://www.webdevtips.com/webdevtips/faq/javascript/index.shtml

    function centerpg(){
    if (window.innerWidth || window.innerHeight){
    //opera Netscape 6 Netscape 4x Mozilla
    docwidth = window.innerWidth;
    docheight = window.innerHeight;
    } else if (document.body.clientWidth || document.body.clientHeight){
    //IE Mozilla
    docwidth = document.body.clientWidth;
    docheight = document.body.clientHeight;
    }
    window.scroll(docwidth/2,docheight/2);
    }

    Mike
     
    mscir, May 2, 2004
    #2
    1. Advertising

  3. TahoeJ

    Karl Groves Guest

    "TahoeJ" <> wrote in message
    news:...
    > I don't know is this is a javascript issue or a general html issue. When

    your page is too high or too wide to fit in the browser window, the browser
    adds a scrollbar(s) so you can navigate to the content that is off screen.
    My question is this: Is there some way (with or without javascript) to cause
    the browser to initially display oversize pages at their CENTER rather that
    at their top and left (which is the default)?

    Here's a wacky idea -
    How about making it fit the screen?

    -Karl
     
    Karl Groves, May 3, 2004
    #3
  4. TahoeJ

    Noozer Guest

    "Karl Groves" <> wrote in message
    news:c743qg$7pl$...
    >
    > "TahoeJ" <> wrote in message
    > news:...
    > > I don't know is this is a javascript issue or a general html issue.

    When
    > your page is too high or too wide to fit in the browser window, the

    browser
    > adds a scrollbar(s) so you can navigate to the content that is off screen.
    > My question is this: Is there some way (with or without javascript) to

    cause
    > the browser to initially display oversize pages at their CENTER rather

    that
    > at their top and left (which is the default)?
    >
    > Here's a wacky idea -
    > How about making it fit the screen?


    If all the pages on the web would fit my 160x280 PDA screen, there would be
    a LOT of wasted real estate out there.

    ....but a page redesign is definately called for in this case.
     
    Noozer, May 3, 2004
    #4
  5. TahoeJ wrote:

    > Is there some way (with or without javascript) to cause the browser to
    > initially display oversize pages at their CENTER rather that at their
    > top and left (which is the default)?


    Probably, but why? Your users will expect the view to be aligned to the
    top of the page, so will instinctively scroll down to read more, but
    probably not up.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, May 3, 2004
    #5
  6. TahoeJ

    TahoeJ Guest

    On Mon, 03 May 2004 12:29:58 +0100, Toby A Inkster
    <> wrote:

    >TahoeJ wrote:
    >
    >> Is there some way (with or without javascript) to cause the browser to
    >> initially display oversize pages at their CENTER rather that at their
    >> top and left (which is the default)?

    >
    >Probably, but why? Your users will expect the view to be aligned to the
    >top of the page, so will instinctively scroll down to read more, but
    >probably not up.



    It's for a page that is a large work of art. No reading is involved.
    The center of the composition is readily apparent and that's what the
    user should see upon opening the page. Since we can't predict the
    user's browser size, the best approach is to start everyone in the
    center and have them "move out" from there, as need be. Starting
    everyone at top left would misrepresent the sense of the artwork for
    user's with modest screen resolutions.

    Dennis
     
    TahoeJ, May 3, 2004
    #6
    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. Luqman
    Replies:
    1
    Views:
    677
    Luqman
    Feb 7, 2006
  2. James Wong
    Replies:
    4
    Views:
    533
    James Wong
    Jul 14, 2004
  3. Replies:
    3
    Views:
    198
  4. James Black
    Replies:
    0
    Views:
    409
    James Black
    May 28, 2006
  5. brendan
    Replies:
    0
    Views:
    213
    brendan
    Aug 29, 2006
Loading...

Share This Page