[Javascript] auto resizing a window

Peter Brunone peter at brunone.com
Mon Nov 5 21:58:22 CST 2001


Kyle,

	What you're saying in the script below, is "if this document is contained
within a frameset, then resize the window".  The problem with that is that
if the condition is true, then you can't resize the window containing the
file, because there isn't one; there is only a frameset, and THAT document
is contained by a window.  Did that make sense?  If anything, such a command
would reduce the size of the frame.
	If you need to resize a window from within one of the frames, try using
top.resizeTo(675,600).  I've tested this in IE 5 and Netscape 4 and it
works; take the frame test out completely and let us know what happens.

Cheers,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Kelly, Kyle
|Sent: Monday, November 05, 2001 6:07 PM
|To: 'javascript at LaTech.edu'
|Subject: RE: [Javascript] auto resizing a window
|
|
|Peter,
|
|thanks for responding. i tried that code, but i must be doing something
|wrong. The page doesn't resize itself, yet...
|
|here is the entire page that i am attempting to get to work: (at this url:
|http://theallthing.taa.usf.edu/ )
|
|i'm getting the error triangle at the bottom left of my IE 6 window that
|says error on page, object expected.
|
|<html><head><link rel="STYLESHEET" type="text/css" href="/tampa.css">
|<script language="JavaScript">
|<!--
|  if (top.frames.length!=0)
|{
|	self.resizeTo(675,600);
|}
|//-->
|</script>
|</head>
|
|<p>&nbsp;</p>
|<p>&nbsp;</p>
|<p>&nbsp;</p>
|<p>&nbsp;</p>
|<table width="500" border="0" align="center">
|  <tr>
|    <td>
|      <p align="center"><font size="4">Welcome to TheAllThing</font></p>
|      <p align="center"><font size="4">TheAllThing is best viewed at
|1024X768
|        <br>
|        Resolution on an Internet Explorer</font></p>
|      <p align="center"><font size="4">&lt;<a href="#"
|onMouseOver="MM_openBrWindow('default1.htm','','scrollbars=yes,widt
|h=675,hei
|ght=600')">Enter</a>&gt;</font></p>
|      </td>
|  </tr>
|</table>
|<p>&nbsp;</p>
|</html>
|
|THANKS,
|KYLE
|




More information about the Javascript mailing list