PDA

View Full Version : Maximize opening window of link


dmk
07-01-2003, 03:04 PM
On my Intranet page, I'm using a JavaScript drop-down menu bar that uses a text file to hold the variables -- the menu items. From one of these drop-downs, I have a link to an Excel file which works, but when that link opens, I need its window to either be maximized, or to fit the dimensions of the user's screen.

This is the code of one of the drop-downs:

Menu2=new Array("Teams","","",5);
Menu2_2=new Array("Corporate","","",8,20,150);
Menu2_2_1=new Array("IRS Fill-in SS-4 form","java script:NewWin=window.open('http://www.irs.gov/pub/irs-fill/fss4.pdf','NWin');window['NewWin'].focus()","",0,20,180);
Menu2_2_2=new Array("Wis Dept Financial Institutions","java script:NewWin=window.open('http://www.wdfi.org','NWin');window['NewWin'].focus()","",0);
Menu2_2_3=new Array("CRIS Search at the DFI","java script:NewWin=window.open('http://www.wdfi.org/corporations/crispix/search.asp','NWin');window['NewWin'].focus()","",0);
Menu2_2_4=new Array("Table of Secretaries of State","java script:NewWin=window.open('http://www.nass.org/sos/sos.html','NWin');window['NewWin'].focus()","",0);
Menu2_2_5=new Array("Wisconsin UCC Forms","java script:NewWin=window.open('http://www.wdfi.org/ucc/forms.htm','NWin');window['NewWin'].focus()","",0);
Menu2_2_6=new Array("National UCC-1 Form","java script:NewWin=window.open('http://www.wa.gov/dol/forms/ucc1.pdf','NWin');window['NewWin'].focus()","",0);
Menu2_2_7=new Array("National UCC Amendment Form","java script:NewWin=window.open('http://www.wa.gov/dol/forms/ucc3.pdf','NWin');window['NewWin'].focus()","",0);
Menu2_2_8=new Array("State Taxation Offices","java script:NewWin=window.open('http://www.taxadmin.org/fta/link/','NWin');window['NewWin'].focus()","",0);
// Menu2_2_9=new Array("Closing Statement","java script:NewWin=window.open('http://dk_intranet/corporate/ClosingStatement.xlt','NWin');window['NewWin'].focus()","",0);


Can the window size be worked into the link? Thanks.

swmr
07-01-2003, 10:43 PM
This method works for me:

<html><head>
<script type="text/JavaScript">
function Max(){
NewWin=window.open("blah.html","","top=2000");
if (NewWin.window.screen){
var w=screen.availWidth;
var h=screen.availHeight;
NewWin.window.resizeTo(w,h);
NewWin.window.moveTo(0,0)}}
</script>
</head><body>
<button onclick="Max()">NewWin</button>
</body></html>

Maybe you could fit it in there somehow?

dmk
07-01-2003, 11:17 PM
I don't know how to go about working it in. But, I believe Sage45 is working on this for me. thx

Kor
07-02-2003, 09:32 AM
That's simple, dmk,

screen.availHeight - the height of the screen in pixels minus any GUI stuff such as the windows taskbar
screen.availWidth - the width of the screen in pixels minus any GUI stuff such as the windows taskbar


and you can use both as simple values, inside any script, when dimensioning pages (or whichever DOM Object defined there).

dmk
07-02-2003, 02:20 PM
I don't know the language -- How do I work that into the code I posted on July 1?