Forum Moderators: open

Message Too Old, No Replies

Keeping space for scrollbar when Netscape doesn't draw it

getting pages to look the same on IE and NN

         

dreaming of nascar

8:13 am on Apr 12, 2003 (gmt 0)

10+ Year Member



My pages are turning out great on IE and then when I switch to check things out on NN (7.0) the page doesn't look quite right. I know what the problem is. It is because IE displays the vertical scrollbar even if there is nothing to scroll and NN does not. I was wondering if anyone had a fix to this issue.

Thanks

D O N

dmorison

8:42 am on Apr 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I don't think there is anything you can do about this, other than force your page to be longer than the screen length so that the scroll bar is in-view all the time in both IE and Navigator.

I've posted this into netscape.public.mozilla.wishlist and was backed up by a number of other users...

This page shows what you're talking about:

<sorry, no personal URLs>

Cheers

[edited by: tedster at 8:51 am (utc) on April 12, 2003]

ShawnR

10:49 am on Apr 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can remove the scroll bar from IE by putting the following attribute in your css for the BODY tag:

overflow: auto;

It is not defined for css1, only css2, so won't work on old browsers, but will on IE6. I suppose IE's default is "scroll", whereas NN's default is "auto".

Another (less preferable) solution (and I'll probably get my WebmasterWorld membership revoked for suggesting this ;-) is to put your page in a frameset, and use the "scrolling" attrib of the <frame> tag.

Shawn

RonPK

2:38 pm on Apr 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A quick and dirty hack:

<body scroll="auto">

Doesn't validate, only affects IE, does what you want.

dmorison

7:45 am on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

The problem is not solved with any of the styling or other HTML or CSS attributes; Internet Explorer reserves space for a scroll bar on the right hand side of the page all the time. It's just greyed out (disabled) if there's nothing to scroll.

This I believe is sensible - the canvas width shouldn't change as a function of length. Thank you Microsoft!

The problem is that Mozilla / Netscape etc. only draw the scroll bar when it is required. For pages that have a centred design, and some pages longer than others it can look real messy on Mozilla with the scrollbar popping in and out of view and your whole page shifting left and right!

Other than a dirty hack (forcing your page length to be longer than it needs to be) I don't believe there is anything that can be done about it! :(

ShawnR

8:46 am on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi dmorrison

What version of IE did you test this on? The CSS solution and the frame hack both have worked for me in the past. I just fired up some old web pages that I used these on in the past to confirm... Haven't tried the <body scroll="auto"> suggestion from Ron, but I have every confidence it will work as well, because the 'scroll' attrib of the <body> tag is an attribute that microsoft introduced in IE4, pre 2001.

I'd be interested if your test results using any of the three solutions don't give the desired results with IE6, so could you please elaborate on your configuration (code snippet & version of IE you tested it on).

Shawn

tedster

9:44 am on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, I just read D-O-N's initial post and realized that he LIKES the look in IE - so his question is more about how to get the scrollbar to appear in Netscape, and not about removing it in Explorer.

So I changed the title of the thread, which was confusing the issue just a bit. Since I created the former version of the title myself by editing, I'm the guy that made the confusion.

None of which gives D-O-N and answer, but at least it focuses the question more exactly.

dmorison

10:33 am on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Shawn,

It's not Internet Explorer that requires a fix - the problem is with browsers that do not reserve space for a scrollbar.

As it is a tricky problem to articulate, I have a demo page that shows exactly what we're talking about.

Can I sticky the URL to you? It's not allowed in the thread...

Cheers

ShawnR

10:56 am on Apr 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for clarifying, Tedster & dmorison

I think the CSS solution might still be worth persuing. In this case, the css setting should be "overflow: scroll;" rather than "overflow: auto;". This works for Opera, but Netscape's implementation of this CSS attribute in NN 7.00 is buggy so it works only "in a manner of speaking" (I don't know if they fixed it in NN7.02.). To overcome NN's bugs, I think what may work is something along the lines of enclosing the whole page in a div, and set the size of the div equal to the window size (Haven't tried it...). The following thread may provide some interesting clues about manipulating these sorts of things, and getting it working cross-browser:

[webmasterworld.com ]

Netscape's (NN 7.00) implementation of the 'scrolling' attrib of the <frame> tag is buggy, so scrolling="yes" won't work (although it does on Opera). (I don't know if they fixed it in (NN7.02))

Shawn

BootySlap

8:50 am on Apr 24, 2003 (gmt 0)

10+ Year Member



I am trying to rid IE of the space left for the scrollbar and yes <body scroll="no"> works but scroll="auto" does not.

And auto is what I need because I want it to scroll when necessary but not leave space for the scrollbar when not necessary!

Anyone solved this one yet?