Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Position of scrollbars

Reply
Thread Tools

Position of scrollbars

 
 
TahoeJ
Guest
Posts: n/a
 
      05-02-2004
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
 
Reply With Quote
 
 
 
 
mscir
Guest
Posts: n/a
 
      05-02-2004
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/domr...ow_ref105.html
http://www.webdevtips.com/webdevtips...pt/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

 
Reply With Quote
 
 
 
 
Karl Groves
Guest
Posts: n/a
 
      05-03-2004

"TahoeJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
Noozer
Guest
Posts: n/a
 
      05-03-2004

"Karl Groves" <(E-Mail Removed)> wrote in message
news:c743qg$7pl$(E-Mail Removed)...
>
> "TahoeJ" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.


 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      05-03-2004
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

 
Reply With Quote
 
TahoeJ
Guest
Posts: n/a
 
      05-03-2004
On Mon, 03 May 2004 12:29:58 +0100, Toby A Inkster
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
advanced q?: mouseup position to caret position? brendan Javascript 0 08-29-2006 10:48 AM
detecting mouse click position in canvas tag has position off James Black Javascript 0 05-28-2006 03:27 AM
Where is Form Relative Position and Absolute Position in VS.Net 2005 ? Luqman ASP .Net 1 02-07-2006 10:27 AM
position image based on document position edouard.lauer@pt.lu Javascript 3 01-14-2006 06:04 PM
How to set position of a web control depending on other control's position at run-time? James Wong ASP .Net Web Controls 4 07-14-2004 10:24 AM



Advertisments