• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Adding Dynamic Positioning to... > Handling Navigator Window Resizing

4.5. Handling Navigator Window Resizing

Navigator 4 has a nasty habit of destroying the layout of positioned elements (including LAYER elements) if the user resizes the browser window. The user may see overlapped text and elements shaped very peculiarly after the resize. There is a scripted workaround you should include in all pages that use positioned elements.

The workaround requires trapping for the resize event and forcing the page to reload. This sequence causes the page to flicker briefly between the jumbled page and the reloaded, properly proportioned page, but it's better than nothing. The following script, taken from the HEAD section of a document, assumes you've included the utility code described earlier in this chapter that defines a global variable called isNav when the current browser is Navigator 4 or later:

function handleResize() {
    location.reload()
    return false
}
if (isNav) {
    window.captureEvents(Event.RESIZE)
    window.onresize = handleResize
}

Internet Explorer 4 handles window resizing more gracefully, automatically reflowing the content without the need for intervention.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint