Closed Thread Icon

Topic awaiting preservation: width of scrollbar (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8202" title="Pages that link to Topic awaiting preservation: width of scrollbar (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: width of scrollbar <span class="small">(Page 1 of 1)</span>\

 
viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 06-04-2002 04:28

I have a code that needs to know the width of the window. I use the default instructions for IE and NE: document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight, document.body.clientHeight, document.body.scrollLeft, document.body.scrollTop, window.pageXOffset and window.pageYOffset, but it seems that IE considers the vertical scrollbar width automatically but Netscape (Gecko) and Mozilla don't. What to do? Is there a way to know the width of the vertical scrollbar?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-04-2002 04:37

No. Usually it's 16 pixels, but you can't be sure of that.

It may be possible to remove the scrollbar, but I can't guarantee it.

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 06-06-2002 19:50

Id try work around it. Ive made plenty of designs in the past that just wouldnt work because of that. Mostly with Frames, I wanted to know the scrollbar width so I could line it up with the frame above it. What is it exactly your doing ?

My scrollbar is 8px I think, so that shows you cant rely on that anyway.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-06-2002 19:56

Default windows scrollbar width is 16 pixels.

Although if your only developing for IE & Windows then you could use srcoll="no" in the <body> tag to switch off the scrollbar.

[This message has been edited by Dracusis (edited 06-06-2002).]

viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 06-06-2002 21:07

I'm using javascript to add a bar atop the page. See live sample at my main page: http://www.viol.net/mohaa
If the window is resized, the bar is also resized. And the bar is always atop.
The problem is that I found out that if I'm using Netscape, then I have to adjust the code, due to the difference in the vertical scrollbar width. Even using only Netscape, if I choose old look or modern look, there is a difference to be considered. Any difference that I do not take into consideration, make the bar atop the page greater than what's necessary, creating the horizontal scrollbar.
Since 95% of my visitors use IE (3% use Netscape and 2% others), I adjusted the code for IE. Netscape and other browsers users will have a horizontal scrollbar. I'm tired of fighting browsers differences.

Note: if you use the top menu and then resize the window to a smaller size, a horizontal scrollbar will be created. This is not my code's fault (the top bar code). This is due to the code of the top menu, a bug. Since I'm not the one that developed the code of the top menu, I don't know how to fix it. Normally, if you use the top menu again, specially the 'Contact' option, the horizontal scrollbar goes away.

[This message has been edited by viol (edited 06-06-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu