Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1597 Is there a way to launch a window that is 80% of full size, but at least a minimum of, say, 640x480?

You are here: irt.org | FAQ | JavaScript | Window | Q1597 [ previous next ]

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>

©2018 Martin Webb