RE: New Browser Window Link problem

by "John Woram" <john(at)woram.com>

 Date:  Mon, 8 Jul 2002 19:19:47 -0400
 To:  <hwg-techniques(at)mail.hwg.org>
 In-Reply-To:  rudy
  todo: View Thread, Original
I sent a few suggestions earlier about how to open a maxed window, but
by accident it went to Jeremy only. But having seen the other
responses, I'm going to toss in my 2-cents worth.

First, I don't think opening a new window "breaks" the Back (history)
button -- it's a new window -- it doesn't *have* any history. If the
new window contains a link to another page, then the Back button will
work on that page, and all subsequent pages. IOW, it's not broken.

Next, the question was about how to open a new window at maximum size,
not "Is it a good idea to open a new window?" The answer to the last
question is "It depends." If there's a good reason to open a new
window, you can provide the means to close it again. Or whatever. So,
here's a few ways to open a maximized window:

1.
function maxSize()
{
maxWindow=window.open('FILENAME.HTM');
maxWindow.moveTo(0,0);
maxWindow.resizeTo(screen.width, screen.height);
}

2.
function maxSize()
{
maxWindow=window.open('FILENAME.HTM'), "", "fullscreen=yes");
}

The first one opens a maxed window with the menu bars, etc. at the
top. The second one fills the entire screen. Replace 'FILENAME.HTM'
with the name of the file you want to open.

 Or,

3. Put these lines into the JavaScript section in the head of the file
you want to open:

window.moveTo(0,0);
window.resizeTo(screen.width, screen.height);

In this case, the back button works fine.

John Woram

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA