오픈창 중앙으로 열기

분류없음 | 2007/03/14 16:17 | 한성민
오픈창 중앙으로 열기 

<head>와</head>사이에 아래 삽입

<script language="JavaScript">
function winCenter() {
   if (document.layers) {
       var sinist = screen.width / 2 - outerWidth / 2;
       var toppo = screen.height / 2 - outerHeight / 2;
   } else {
       var sinist = screen.width / 2 - document.body.offsetWidth / 2;
       var toppo = -75 + screen.height / 2 - document.body.offsetHeight / 2;
   }
   self.moveTo(sinist, toppo);
}
</script>

===========================================================

body에 onLoad="winCenter();" 추가

[출처 vic21.com]