View Full Version : pop-up window size

10-08-2002, 03:24 PM
I have a query on the following script in which the 'maximise' button is greyed out in the pop-up window. I need to be able to allow the window to be either maximised or resized to allow for different content width/height (i.e. one use of the pop-up is for a flash video presentation which is currently cut in half. Any advice would be appreciated:

<script language="Javascript">
// Hide from old browsers
var p,MyPopup;


// Call this as following example
// Note use of single and double quotes
// <a href="javascript:PopWin('xxxx.html')"

function PopWin(fname){

if (MyPopup && !MyPopup.closed) // if already open then close it

p="top=0,left=0,Width="; // set top and left start points
p += (screen.width-470); // adjust width here
p += ",height=";
p += (screen.height-130); // adjust height here
p += ",scrollbars=yes";
MyPopup = window.open(fname, 'mypage', p); // opens the file 'fname' and gives it a name
// End hide from old browsers


10-08-2002, 04:55 PM
Should work.

p += ",scrollbars=yes,resizable=yes";

10-08-2002, 10:13 PM
Thanks, Paulette. Just as an extra query can you confirm that the default on all conditions such as 'scrollbars'; 'resizable'; etc is NO if the condition isn't specifically written into the script (as was the case with 'resizable' in this script).

10-08-2002, 10:24 PM
Sorry, I should have been asking about attributes rather than conditions. Also a quick check of the tutorials at javascriptkit suggests that if the attribute isn't included in the script it does default to OFF.