Wednesday, August 17, 2011

How to make new window open at maximum size


Here is the tips for 'how to make new window open in maximum size using JavaScript'.

Basically we can’t control to open new pop up in new window with maximum size of browser, because OS setting of end user control.
But we can set the size of window wile opening new window. Here is example to open new pop op window in full screen:

Open new pop up window in full screen:
window.open('newWin.html','NewWindow','fullscreen=yes');

Another option to open new pop up window with dynamic size

 <a href="http://birenj2ee.blogspot.com/" onclick="window.open(this.href, 'child', 'height=' + screen.height + ',width=' + screen.width + ',resizable=yes'); return false">BirenJ2ee</a>

Another example to open pop up window with specific width and height:

window.open('http://birenj2ee.blogspot.com/','NewWindow','width=1000px,height=550px,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');

No comments:

Post a Comment