I'm using Javascript's self.open()
to open a link in a new window and i'd like that window to be maximized. I tried the fullscreen=yes
option, which really doesn't do what I want. I am using below code:
self.open(pageLoc,popUpName,'height=1600,width=1800,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes');
If i also mention fullscreen=yes
, then window opens up like you press F11. But i don't want it that. What i want is when i double click on IE and click maximize icon on top right corner.
As i have given the height
and width
value so large, it is close to maximized window but not actual maximized window. (the reason i am saying this because even now if i click maximize button, it further expans little bit)
In the Properties window, click the Shortcut tab (A). Locate the Run: section, and click the down arrow on the right side (red circle). In the drop-down menu that appears, select Maximized (B). Click Apply (C), and then click OK (D).
self. open(pageLoc,popUpName,'height=1600,width=1800,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes');
var params = [ 'height='+screen.height, 'width='+screen.width, 'fullscreen=yes' // only works in IE, but here for completeness ].join(','); // and any other options from // https://developer.mozilla.org/en/DOM/window.open var popup = window.open('http://www.google.com', 'popup_window', params); popup.moveTo(0,0);
Please refrain from opening the popup unless the user really wants it, otherwise they will curse you and blacklist your site. ;-)
edit: Oops, as Joren Van Severen points out in a comment, this may not take into account taskbars and window decorations (in a possibly browser-dependent way). Be aware. It seems that ignoring height and width (only param is fullscreen=yes
) seems to work on Chrome and perhaps Firefox too; the original 'fullscreen' functionality has been disabled in Firefox for being obnoxious, but has been replaced with maximization. This directly contradicts information on the same page of https://developer.mozilla.org/en/DOM/window.open which says that window-maximizing is impossible. This 'feature' may or may not be supported depending on the browser.
window.open('your_url', 'popup_name','height=' + screen.height + ',width=' + screen.width + ',resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With