Forum Moderators: open

Message Too Old, No Replies

Window sizes...please help

         

Xahr

2:54 am on Apr 7, 2004 (gmt 0)

10+ Year Member



Hello all.

I am working on my digital portfolio/resume. I need the window the site opens in to have certain dementions to it. I've scoured the 'net trying to figure out how. I can make it a pop-up window, but then I've got an extra window just sitting there, which is no good. If anyone knows how to set a website's dimentions (width and height, not file size) Please tell me. Thank you.

Birdman

3:15 am on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just close the original window with JavaScript and the opener object.

Example
Original page:
OpenWin = this.open(page,"PopupWindow",'width=500,height=400,scrollbars=1');

Your sized page:
<body onload ="opener.close();">

Forgive me if the syntax is not correct, but it should get you where you are going, none the less. I hope ;)

Birdman

Xahr

3:30 am on Apr 7, 2004 (gmt 0)

10+ Year Member



Thanks, that works now.

But is there a way I can get the window to close without the goofy thing popping up asking me if I Want to close it?

tedster

4:05 am on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's an important security feature in javascript that you can only close the windows that you also opened. Therefore, the user must give permission if you try to close a window that they opened.

So your choices are either leaving the "extra" window open in the background, or seeing the permission alert box.

Xahr

2:07 pm on Apr 7, 2004 (gmt 0)

10+ Year Member



Hmm, alright. Then is there any way to set the size of the window without making it a pop-up?