Pops a window relative to the current window positionfunction popup (URL, Winname, Xoffset, yoffset) { var x = (Wind Ow.screenx | | Window.screenleft | | 0) + (Xoffset | | 0); var y = (Window.screeny | | window.screentop | | 0) + (Yoffset | | 0); return window.open (URL, winname, ' top= ' +y+ ', left= ' +x)}
Http://stackoverflow.com/questions/57652/how-do-i-get-javascript-to-open-a-popup-window-on-the-current-monitor
Center display:
function Openwin (sURL, Swindowname, W, H, Sscroll) { var x = (Window.screenx | | window.screenleft | | 0) + (screen. WIDTH-W)/2; var y = (Window.screeny | | window.screentop | | 0) + (screen.height-h)/2; if (sscroll==null) Sscroll = "no";//"yes" or no var soption = ""; Soption = soption + "Toolbar=no, Channelmode=no, Location=no, Directories=no, Resizable=yes, menubar=no"; Soption = Soption + ", scrollbars=" + Sscroll + ", left=" + x + ", top=" + y + ", width=" + W + ", height=" + H; var win = window.open (sURL, Swindowname, soption); Win.focus (); return win; }
Multi-monitor, window.open positioning