Position of scrollbars

T

TahoeJ

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
 
M

mscir

TahoeJ said:
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
 
K

Karl Groves

TahoeJ said:
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
 
N

Noozer

Karl Groves said:
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.
 
T

Toby A Inkster

TahoeJ said:
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.
 
T

TahoeJ

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top