Using Javascript to open a maximized window in IE6?

Any idea for this?

Problems arose: using screen.availHeight and screen.availWidth as the height and width parameters in window.open forces the browser size to include the taskbar, and positioning at (0, 0) ignores the possibility of finding the taskbar.

I want to open a new window with the size, as if it were "maximized" by the user, i.e. it should not have closed the Windows taskbar.

(Oh, and you don’t need to remind me that users don’t like Javascript interfering with their browser windows, etc. This is for the intranet webapp ...)

+6
javascript internet-explorer
source share
7 answers

Does this cause the same problems?

<script type="text/javascript"> window.moveTo(0,0); window.resizeTo(screen.width,screen.height); </script> 
+4
source share

This may come close to what you want:

 window.moveTo(screen.width - screen.availWidth, screen.height - screen.availHeight); window.resizeTo(screen.availWidth + screen.availWidth - screen.width, screen.availHeight + screen.availHeight - screen.height); 
+1
source share

Try this to open maximized and deleted settings, to block users from messing with your internal site. You can play with restrictions according to your requirements.

 function openFullscreen(url) { // get the height correction for IE and set the window height and width var height = screen.availHeight; var width = screen.availWidth; var fullscreen = (document.all) ? "no" : "yes"; var resizable = "no"; var toolbar = "no"; var status = "no"; var left = 0; var top = 0; //set window properties props = "toolbar=no" + ",fullscreen=" + fullscreen + ",status=no" + ",resizable=no" + ",scrollbars=no" + ",menubar=no" + ",location=no" + ","; dims = "width="+ width + ",height="+ height + ",left="+ left + ",top=" + top; var win = window.open("", name, props + dims); win.resizeTo(width, height); win.location.href = url; win.focus(); } 
+1
source share

Unfortunately, IE (8-) does not support the availLeft / availTop ...

+1
source share

Taking a quick look at it seems

 window.moveTo(screen.availLeft, screen.availTop); window.resizeTo(screen.availWidth, screen.availHeight); 

may be the best way - I believe this should return exactly the available screen width (It seems to work on the same monitor if you have multiple monitors).

However, this is not an ideal solution. If anyone has any suggestions on how to open a real window with maximization, I would be interested to hear

0
source share
 <script type="text/javascript"> window.moveTo(screen.width-screen.availWidth,screen.height-screen.availHeight); window.resizeTo(screen.availWidth,screen.availHeight); </script> 
0
source share

This code opens the window as much as possible, but will it open the links from this window as much as possible

I have base target=main in front of the closing head tag. It is very important that this code be the last tag before the closing head tag, and if any links on the page have target="_parent .

Everything from your page will open in full screen if the size is not specified from the button code, and if the button code contains a code to indicate the target tag go target="parent .

I tried all the codes, but there maxed codes lose it after several links oh .. and, as I just showed, it makes a true maxed window, not a floating size window

-one
source share

All Articles