[thelist] Re: centering a popup window.....

Ben Gustafson ben_gustafson at lionbridge.com
Thu Feb 1 11:34:51 CST 2001


Below are Netscape- and IE-compatible ways to detect the visitor's monitor
dimensions and available browser window dimensions (minus the "chrome"):

<script language="JavaScript1.2"><!--
alert("monitor width: " + window.screen.width + "\nmonitor height: " +
window.screen.height);

if(navigator.appName == "Netscape") {
	alert("NN browser window width minus chrome: " + window.innerWidth +
	"\nNN browser window height minus chrome: " + window.innerHeight);
} else {
	alert("IE browser window width minus chrome: " + document.body.clientWidth
+
	"\nIE browser window height minus chrome: " + document.body.clientHeight);
}
//--></script>

Note that the script must go within the Body tags in the HTML document for
the browser window dimension detecting to work.

--Ben





More information about the thelist mailing list