새창 모니터 한 가운데 띄우도록 하는 스크립트
var windowWidth = 200;
var windowHeight = 200;
var windowLeft = parseInt((screen.availWidth/2) - (windowWidth/2));
var windowTop = parseInt((screen.availHeight/2) - (windowHeight/2));
var windowSize = "width=" + windowWidth + ",height=" + windowHeight + "left=" + windowLeft + ",top=" + windowTop + "screenX=" + windowLeft + ",screenY=" + windowTop;
일반적인 새창 구현하는 방법
<html>
<head>
<title></title>
<script type=
"text/javascript"
>
var
windowSizeArray = [
"width=200,height=200"
,
"width=300,height=400,scrollbars=yes"
];
$(document).ready(
function
(){
$(
'.newWindow'
).click(
function
(event){
var
url = $(
this
).attr(
"href"
);
var
windowName =
"popUp"
;
var
windowSize = windowSizeArray[$(
this
).attr(
"rel"
)];
window.open(url, windowName, windowSize);
event.preventDefault();
});
});
</script>
</head>
<body>
</body>
</html>