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

Q1395 How can I open popup windows as a percentage of monitor size?

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

Try:

<script language="JavaScript"><!--
function openWindow(percent) {
    var w = 630, h = 440; // default sizes
    if (window.screen) {
        w = window.screen.availWidth * percent / 100;
        h = window.screen.availHeight * percent / 100;
    }

    window.open('nextpage.htm','windowName','width='+w+',height='+h);
}
//--></script>

©2018 Martin Webb