Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.