fixing the netscape layer bug...

the content you are reading resides on a dhtml layer with an absolute position assigned. in netscape 4.*, when you resize the window, the browser loses the layout attributes of the layer. (for proof, start netscape, then visit this page without the fix, and then resize your browser).

in order to fix that bug, we can do one of two things: 1) we can add a table around the contents of the layer with the width set to the same width as the layer, or 2) we can use javascript.

the table fix can be seen working here. thanks to mike ball from ontario, canada for sharing this extremely handy workaround.

the javascript fix is a little more complicated. it works like this: we take note of the height and width of our layer's contents when the page loads. then when the browser is resized, we call a function which compares the new dimensions of our layer with the original dimensions. if they are different, we reload the page, thus resetting the page layout.

you can use either of these fixes freely on any project, commercial or otherwise, cause it's such a damn pain, no one should charge for fixing it :). to use the javascript fix, just save this page and set the first variable ("layertoCheck") to match the name of any problematic layer in your document. the code is commented for reference. maybe one day netscape will actually qa their browser before releasing it.

back to javascript utopia

revision history
december 8, 1999: posted.
july 04, 2000: updated to include table fix approach.