SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast vladanik's Avatar
    Join Date
    Oct 2001
    Location
    Belgrade, Serbia
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Netscape 4.x resize problem

    I have a question about the famous NN 4.x resize problem.

    I've been doing some searching on the subject and here's what I found out:

    1) Resizing of NN 4 sometimes messes up the layout
    of the page - this one is OK

    2) NN 4.x interprets every page load as a resize - this one is not OK

    I tried doing this:

    <script language="JavaScript">
    <!--
    function radi() {
    window.location.reload();
    }
    //-->
    </script>

    <body onresize="radi()">

    If that was true, then this script should have put NN
    into endless looping, which didn't happen, neither
    in NN 4.03 nor in NN 4.5

    3) On this page http://www.webreference.com/dhtml/di...e/resize1.html
    it said that NN doesn't triger a resize event when it loads
    a page, but when it shows scrollbars. I can not find some confirmation or proof,
    for that one either.

    They even have an example page at http://www.webreference.com/dhtml/di...e/resize2.html
    but when I tried their examples in both NN 4.03 and NN 4.5
    they didn't work like they said it would. NNs didn't triger
    an onresize event when they showed the scrollbars.

    Does NN 4.x really triger a resize event when it loads a page or
    does it trigger a resize event when it shows scrollbars?
    If it's the first case, is there something wrong with my script above?
    Why doesn't it work on my machine?

    Are the examples on the webreference pages working to you
    like they're supposed to, are they trigering the resize event
    when the scrollbars are shown?

    Could someone please help me with this. I'm desperate. I'm even starting
    to think there is no NN 4.x bug

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For NN4 I simulate the window onresize and onscroll events - so you don't have to worry about the browser quirks. This is a simple example but should convey the concept. I use the same technique for simulating the window scroll event.
    Code:
    <html>
    <head>
    <script type='text/javascript'>
    var prevW, prevH;
    window.onload = function() {
      if (document.layers) {
        prevW = window.innerWidth;
        prevH = window.innerHeight;
        setTimeout("simResizeEvent()", 500);
      }
      else if (window.addEventListener) {
        window.addEventListener('resize', onResizeEvent, false);
      }
      else {
        window.onresize = onResizeEvent;
      }
    }  
    function simResizeEvent() {
      if (window.innerWidth != prevW || window.innerHeight != prevH) {
        resizeListener();
      }
      else setTimeout("simResizeEvent()", 500);
    }
    function resizeListener() {
      if (document.layers) history.go(0);
      else {
        // ...
      }
    }
    </script>
    </head>
    <body>
    <h1>Window onresize and onscroll event simulation example</h1>
    </body>
    </html>
    Last edited by MikeFoster; Mar 22, 2003 at 18:25.

  3. #3
    SitePoint Enthusiast vladanik's Avatar
    Join Date
    Oct 2001
    Location
    Belgrade, Serbia
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MikeFoster
    For NN4 I simulate the window onresize and onscroll events - so you don't have to worry about the browser quirks. This is a simple example but should convey the concept. I use the same technique for simulating the window scroll event.
    Thanks, but that's not what I need. I already have a reload script.

    The problem is that my NN 4.03 and 4.5 don't interpret a page load nor the showing of the scrollbar as a resize. Maybe they don't have that bug??? Or maybe I'm doing something wrong with my script (see No. 2 above).

    Do you know which versions of NN have that bug? I've heard that not all 4.x versions have that scrollbar bug (or is it a page load bug).

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've already done good research on the bug. I don't know any more about it than what you've already found.

    There's no need to worry about those bugs if you use event simulation.

    Sorry I couldn't help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •