| centering pop up windows
|
deltron23

msg:1479446 | 10:13 pm on Mar 12, 2003 (gmt 0) | What can I add to this script to make the pop up window in IE and Netscape centered. <SCRIPT LANGUAGE="Javascript"> var browser1 = navigator.appName; if (browser1 == "Microsoft Internet Explorer"){ var newWin = window.open("features.htm", "method_desc", "status=no,width=755,height=480"); } else { var newWin = window.open("nfeatures.htm", "method_desc", "status=no,width=755,height=480"); } </SCRIPT>
|
tedster

msg:1479447 | 1:57 am on Mar 13, 2003 (gmt 0) | IE and Netscape use different variables in the window.open() method's feature string to position a new window. So you'll need to declare 4 variables: top= and left= for IE; screenX= and screenY= for Netscape. Now on to the calculations. You can use screen.width to calculate left= and screenY= values with (screen.width-755)/2. A parallel approach would generate the vertical coordinates.
|
|
|