copyright © CSSPG, lud July 22 1999


 for practical use of CSS

Workarounds

this document is located at...
<URI:http://css.nu/faq/nn-resize.html>

* Netscape re-size bug *

In Navigator 4.0, JavaScript positioned content loses shaped when the window is resized.

This is the JavaScript to fix the Netscape resize problem. Just cut and paste into your favorite editor, and save as resize.js

/**
 * resize.js 0.3 970811
 * by gary smith
 * js component for "reloading page onResize"
 */

if(!window.saveInnerWidth) {
  window.onresize = resizeIt;
  window.saveInnerWidth = window.innerWidth;
  window.saveInnerHeight = window.innerHeight;
}

function resizeIt() {
    if (saveInnerWidth < window.innerWidth || 
        saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || 
        saveInnerHeight < window.innerHeight ) 
    {
        window.history.go(0);
    }
}

Then, include the following line in your document:

<SCRIPT LANGUAGE="JavaScript1.2" SRC="resize.js" TYPE="text/javascript">
</SCRIPT>

From Netscape's DHTML Technotes.


CSS Pointers Navigation
Index · Browser Bugs · Books · Tools · DHTML · XSL & DSSSL
Main Site Navigation
Index · Articles · Examples · Experiments · FAQ · Markup · Styles · Who is?
CSSPG ~ Sue ~ Roland
Validate markup Check CSS