본문 바로가기
프로젝트/첫번째 jsp eclipes html 을 활용한..

팝업창 중앙정렬

by IT새내기IM 2023. 1. 31.

var popupWidth = 600;
var popupHeight = 182;
var popupX = (window.screen.width / 2) - (popupWidth / 2);
//만들 팝업창 width 크기의 1/2 만큼 보정값으로 빼주었음
var popupY= (window.screen.height / 2) - (popupHeight / 2);
//만들 팝업창 height 크기의 1/2 만큼 보정값으로 빼주었음

 


function id_s(){
window.open('/member/id_search.jsp', 'd', 'status=no, height=' + popupHeight  + ', width=' + popupWidth  + ', left='+ popupX + ', top='+ popupY);
}
function pass_s(){
window.open('/member/pass_search.jsp', 'd', 'status=no, height=' + popupHeight  + ', width=' + popupWidth  + ', left='+ popupX + ', top='+ popupY);
}

function popupCenter(){
window.open('/member/pass_search.jsp', 'd', 'status=no, height=' + popupHeight  + ', width=' + popupWidth  + ', left='+ popupX + ', top='+ popupY);
}

 

status= no 상태바를 보여줄지 지정

댓글