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

Q654 How can you specify the size of a window with window.open() so that both Netscape Navigator & Internet Explorer open a window with the same size document area?

irt.org | Knowledge Base | JavaScript | Window | Q654 [ previous next ]

Q654 How can you specify the size of a window with window.open() so that both Netscape Navigator & Internet Explorer open a window with the same size document area?

Work out the size difference, and then use JavaScript code similar to:

<SCRIPT LANGUAGE="JavaScript"><!--
function myOpen(page,width,height) {
    if (navigator.appName == 'Netscape') {
        adjWidth = width + 20;
        adjHeight = height + 20;
    }
    else {
        adjWidth = width + 50;
        adjHeight = height + 150;
    }
    
    window.open(page,'windowName','width=' + adjWidth + ',height=' + adjHeight + ',toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes');
}

myOpen('irt.gif',170,66);
//--></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.