Problem with XP, IE6 and window.resizeTo()

  • Thread starter Thread starter Captain Nemo
  • Start date Start date
C

Captain Nemo

Hi

I've written some javascript code for a pop-up window which presents a
series of images. These images are of various dimensions, so that when each
picture is loaded, the window is resized accordingly.

All this works absolutely fine on my system (IE6 running on Win98) but I'm
told there are problems on XP. Basically, what happens is that once the
window height has been reduced, it then fails to increase for the next
image.

Here is a very simplified version of the code that resizes the window. The
parameters iWidth and iHeight are the actual dimensions of the current
image.

var WindowWidth = iWidth + 200;
if (WindowWidth < 750)
WindowWidth = 750;
window.resizeTo(WindowWidth, iHeight + 210);

Any suggestions?

Thanks.
 
Well, since nobody answered I thought I'd let you all know I figured it out
myself.

The limitations on Pop-up windows (in XP Service Pack 2) include that a
window may not be resized so that the status bar is off-screen. Thus, if
you're resizing a window (already centered in the screen) so as to make it
taller, there is a danger this could happen. In this case, the resize may
be limited or even ignored altogether.

The remedy is that before resizing and re-centering a pop-up window, make a
call to window.moveTo(0,0) just to be safe.
 
Back
Top