View
function auto_fit_size() {
window.resizeTo(100, 100);
var thisX = parseInt(document.body.scrollWidth);
var thisY = parseInt(document.body.scrollHeight);
var maxThisX = screen.width - 50;
var maxThisY = screen.height - 50;
var marginY = 0;
//alert(thisX + "===" + thisY);
//alert("임시 브라우저 확인 : " + navigator.userAgent);
// 브라우저별 높이 조절. (표준 창 하에서 조절해 주십시오.)
if (navigator.userAgent.indexOf("MSIE 6") > 0) marginY = 60; // IE 6.x
else if(navigator.userAgent.indexOf("MSIE 7") > 0) marginY = 80; // IE 7.x
else if(navigator.userAgent.indexOf("Firefox") > 0) marginY = 50; // FF
else if(navigator.userAgent.indexOf("Opera") > 0) marginY = 30; // Opera
else if(navigator.userAgent.indexOf("Netscape") > 0) marginY = -2; // Netscape
if (thisX > maxThisX) {
window.document.body.scroll = "yes";
thisX = maxThisX;
}
if (thisY > maxThisY - marginY) {
window.document.body.scroll = "yes";
thisX += 19;
thisY = maxThisY - marginY;
}
window.resizeTo(thisX+10, thisY+marginY);
}
<body onLoad="auto_fit_size();">
팝업사이즈를 자동체크하여 알아서 팝업사이즈를 맞춰준다.