본문 바로가기

Programming

팝업창 화면 중앙에 띄우기

<script type="text/javascript">
 var winWidth = 300;
 var winHeight = 250;
 var winURL = "";
 var winName = "";
 var winPosLeft = (screen.width - winWidth) / 2;
 var winPosTop = (screen.height - winHeight) / 2;
 var winOpt = "width="+winWidth+",height="+winHeight+",top="+winPosTop+",left="+winPosLeft;
 window.open(winURL, winName, winOpt + ",menubar=no,status=no,scrollbars=no,resizable=no");
</script>