Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Resizing Popup Windows


Message #1 by "Paul Grattidge" <paul@g...> on Fri, 31 Aug 2001 11:04:17
Here's a really rough start at resizing a window once it's open, and
specific to IE. Note that you'll need to modify the dimensioning better to
account for the title bar, etc., but I hope this is a start...

<html>
<head>
<title>Test Window Opening</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- begin script
function FitToImg() {
   window.resizeTo(imgShapes.width, imgShapes.height);
}
//  end script -->
</SCRIPT>
</head>
<body onload="FitToImg()">
<img id="imgShapes" name="imgShapes" src="shapes.gif">
</body>
</html>


Warrick
mailto:wwilson@f...



> -----Original Message-----
> From: Paul Grattidge [mailto:paul@g...]
> Sent: Friday, August 31, 2001 11:04 AM
> To: JavaScript HowTo
> Subject: [javascript_howto] Resizing Popup Windows
>
>
> Hello All,
> Can anyone tell me if it is possible to create a popup window in
> javascript that automatically sets its size to the image
> displayed in it,
> or to resize the window once the image is loaded?? This would save me
> setting the ?height? and ?width? attributes all the time.
>
> Thanks,
> Mex


  Return to Index