/** * 팝업 관련 js * @author 이호영 * @since 2023.02.23 * @version 1.0 * @see * *
* << 개정이력(Modification Information) >> * * 수정일 수정자 수정내용 * ---------- -------- --------------------------- * 2023.02.23 이호영 최초 생성 * **/ var Width = 1400; var Height = 800; function showPopup(popUrl, popName, width, height) { width = (typeof width === 'undefined')?Width:width; height = (typeof height === 'undefined')?Height:height; /* if(typeof width === 'undefined') { width = Width; } if(typeof height === 'undefined') { height = Height; } */ // console.log(width, 'x', height); // 스크린 가로사이즈 var screenW = screen.availWidth; // 스크린 세로사이즈 var screenH = screen.availHeight; // 띄울창의 가로사이즈 var popW = width; // 띄울창의 세로사이즈 var popH = height; // 띄울창의 가로포지션 var posL = (screenW-popW) / 2; // 띄울창의 세로포지션 var posT = (screenH-popH) / 2; var popupX = (document.body.offsetWidth/2)-(width/2); var popupY = (window.screen.height/2) - (height/2); // console.log(popW, popH, posT, posL, popupX, popupY); posL = popupX; posT = popupY; // console.log(popW, popH, posT, posL); var newWindow = window.open(popUrl, popName, "status=no, width="+popW+", height="+popH+", top="+ posT + ", left="+ posL + ", resizable=no, scrollbars=yes"); if (window.focus) {newWindow.focus()} if (!newWindow.closed) {newWindow.focus()} return false; } function showPopup2(popUrl, popName, width, height, posL ,posT) { width = (typeof width === 'undefined')?Width:width; height = (typeof height === 'undefined')?Height:height; /* if(typeof width === 'undefined') { width = Width; } if(typeof height === 'undefined') { height = Height; } */ // console.log(width, 'x', height); // 스크린 가로사이즈 var screenW = screen.availWidth; // 스크린 세로사이즈 var screenH = screen.availHeight; // 띄울창의 가로사이즈 var popW = width; // 띄울창의 세로사이즈 var popH = height; // 띄울창의 가로포지션 //var posL = (screenW-popW) / 2; // 띄울창의 세로포지션 //var posT = (screenH-popH) / 2; var popupX = (document.body.offsetWidth/2)-(width/2); var popupY = (window.screen.height/2) - (height/2); // console.log(popW, popH, posT, posL, popupX, popupY); //posL = popupX; //posT = popupY; // console.log(popW, popH, posT, posL); var newWindow = window.open(popUrl, popName, "status=no, width="+popW+", height="+popH+", top="+ posT + ", left="+ posL + ", resizable=no, scrollbars=yes"); if (window.focus) {newWindow.focus()} if (!newWindow.closed) {newWindow.focus()} return false; }