|
Q1597 Is there a way to launch a window that is 80% of full size, but at least a minimum of, say, 640x480?
irt.org | Knowledge Base | JavaScript | Window | Q1597 [ previous next ]
Q1597 Is there a way to launch a window that is 80% of full size, but at least a minimum of, say, 640x480?
Try:
<script language="JavaScript"><!--
var w=640;
var h=480;
if (window.screen) {
w = parseInt(window.screen.availWidth * 0.80);
h = parseInt(window.screen.availHeight * 0.80);
}
(w < 640) ? w = 640 : w = w;
(h < 480) ? h = 480 : h = h;
window.open('mypage.html','windowName','width='+w+',height='+h);
//--></script>
|
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.