Automatic Maximize When Open New Window
Some project in my office want to open a new window with automatically maximize. I have to google about this, and there is some resource out there that is not work. So I have try to combine some resource and my knowledge about javascript and found a code and it's work.
This is my code.
<SCRIPT LANGUAGE="JavaScript">
function openWindow(URL)
{
var availHeight = screen.availHeight;
var availWidth = screen.availWidth;
var x = 0, y = 0;
if (document.all) <!--For IE or Mozilla-->
{
x = window.screenTop;
y = window.screenLeft;
}
else if (document.layers) <!--For Navigator-->
{
x = window.screenX;
y = window.screenY;
}
var arguments = 'resizable=1, toolbar=1, location=1, directories=1, addressbar=1, scrollbars=1, status=1, menubar=1, top=0, left=0, screenX='+x+', screenY='+y+', width='+availWidth+', height='+availHeight;
newWindow = window.open(URL,'',arguments);
}
</SCRIPT>