본문 바로가기
웹프로그램

자바스크립트 윈도우를 가운데로 오게 하기

by 세이박스 2008. 11. 7.
반응형
<html>
<head>
<script language="javascript">
var win = null;
function NewWin(url,winname,w,h,scroll) {
  winToTop = (screen.height) ? (screen.height-h)/2 : 0;
  winToLeft = (screen.width) ? (screen.width-w)/2 : 0;
  making = 'height='+h+',width='+w+',top='+winToTop+',left='+winToLeft+',scrollbars='+scroll+',resizable'
  win = window.open(url,winname,making)
}
</script>
</head>
<body>
<p align="center">
<a href="http://saybox.tistory.com" onclick="NewWin(this.href,'name','650','400','yes');return false">세이박스</a>
| <a href="http://saybox.tistory.com" onclick="NewWin(this.href,'name','650','400','yes');return false">세이박스</a>
| <a href="http://saybox.tistory.com" onclick="NewWin(this.href,'name','650','400','yes');return false">세이박스</a>
| <a href="http://saybox.tistory.com" onclick="NewWin(this.href,'name','650','400','yes');return false">세이박스</a>
</p>
</body>
</html>
반응형