RE: resize window

by "Katherine Pollara" <kpollara(at)home.com>

 Date:  Mon, 25 Jun 2001 15:47:08 -0400
 To:  "'Ed Peddycoart'" <epeddycoart(at)cg2.com>,
"'HWG-Basics'" <hwg-basics(at)hwg.org>
 Cc:  "'Larry Coats'" <lcoats(at)gte.net>
 In-Reply-To:  cg2
  todo: View Thread, Original
you can open a new window in straight html, but I don't know of any way of
controlling the window size wihtout using javascript or similar concept.

To launch a separate window: add this attribute to you link tag:
target="display".
See this technique here:
http://jsjbf.com/jsjbflinks.html#bands

Kate Pollara



-----Original Message-----
From: owner-hwg-basics(at)hwg.org [mailto:owner-hwg-basics(at)hwg.org]On
Behalf Of Ed Peddycoart
Sent: Monday, June 25, 2001 2:22 PM
To: HWG-Basics
Cc: Larry Coats
Subject: RE: resize window


Actually, I should have been more specific...I would like to open a new
window of specific height and width, but without using Javascript, or DHTML.
Is it possible with standard HTML?

I have a form, which is processed by a php script.  The resulting html is
displayed in a new blank window via the target="_blank".  I am looking for a
way to specify the size of this new blank window.

<.form action="showalumnus.php" method="post" name="RegistrantsMenu"
target="_blank">
blah blah blah
<./form>

Ed


-----Original Message-----
From: Larry Coats [mailto:lcoats(at)gte.net]
Sent: Monday, June 25, 2001 8:52 AM
To: Ed Peddycoart
Cc: HWG-Basics
Subject: Re: resize window




Ed Peddycoart wrote:

> I have a link on my site that opens a new browser window.  I want to be
able
> to open this window at a specific size (width and height), but still
> allowing the user to resize it.  Is this possible using HTML? (Or for the
> PHP-ers out there, is it possible using PHP?)

I presume you're using JavaScript to open your window, with something like
this:

<.a href="#"
onclick="window.open('url','window','height=nnn,width=nnn')">link
text<./a>

Besides width and height, there are a bunch of options you can specify. If
you
specify any of them, all the others default to no. I generally include the
entire list and indicate which I want -- makes it easier to remember what to
specify if I want to change it later. They include:

resizable (this is the one you're looking for)
toolbar
location
directories
status
menubar
scrollbar
copyhistory

I usually create a variable that has the string I want to use -- that way,
the
code in the onclick doesn't go on for a mile. And if you include the url in
the
href attribute and include target="_blank", your link works -- complete with
a
new window -- even for people who have javascript disabled (although you
have no
control over the size or options of the new window).

So I'd have something like this in the head section:

<.script language="javascript" type="text/javascript">
<.!--
  var options = "resizable=yes,toolbar=yes,location=yes," +
        "directories=no,status=yes,menubar=yes,scrollbar=yes," +
        "copyhistory=no,width=640,height=480";
//-->
<./script>

Then for the link:

<.a href="url" target="_blank"
    onclick="window.open('url','window',options)">link text<./a>

Larry Coats

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA