function winResize() {
var Dwidth = parseInt(document.body.scrollWidth);
var Dheight = parseInt(document.body.scrollHeight);
var divEl = document.createElement("div");
divEl.style.position = "absolute";
divEl.style.left = "0px";
divEl.style.top = "0px";
divEl.style.width = "100%";
divEl.style.height = "100%";
document.body.appendChild(divEl);
//document.body.insertBefore(divEl, document.body.firstChild);
//alert("Dwidth : " + Dwidth + ", divEl.offsetWidth : " + divEl.offsetWidth + ",
//Dheight : " + Dheight + ", divEl.offsetHeight : " + divEl.offsetHeight);
if(navigator.userAgent.indexOf("MSIE") !=-1)
window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight + 10);
else
window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
document.body.removeChild(divEl);
}
<body onLoad="winResize()">
'Frontend > JS' 카테고리의 다른 글
jQuery Ajax 요청 취소하기 (0) | 2016.09.08 |
---|---|
JQuery - Select (0) | 2012.02.21 |
글자 수 체크 스크립트 (0) | 2011.02.24 |