내장객체 Screen 객체
페이지 정보

본문
- screen.availHeight : 브라우저의 전체 높이
- screen.availWidth : 브라우저의 전체 너비
- screen.height : 모니터의 해상도 높이 ",);
- screen.width : 모니터의 해상도 너비
- document.body.clientHeight : 브라우저 안쪽의 높이
- document.body.clientWidth : 브라우저 안쪽의 너비
- document.body.scrollHeight : 문서 높이
}
댓글목록
등록된 댓글이 없습니다.


screen.availWidth; //화면 폭
screen.availHeight; //화면 높이
브라우저내에서의 페이지 폭과 높이는..
document.body.clientWidth; //브라우저 폭
document.body.clientHeight; //브라우저 높이
(활용사례) ---------------------------------------
ffff
//팝업 자바스크립트 (화면중앙에 띄우기)
function gamePop(name,W,H){
var left = parseInt((screen.availWidth/2) - (W/2));
var top = parseInt((screen.availHeight/2) - (H/2));
window.open("./swf/"+name+".html","gameWindow","width="+W+", height="+H+",left="+left+",top="+top+", status=1");
return false;
}
//팝업레이어 (페이지중앙에 레이어 띄우기)
function viewPop(fileNm, cont){
$("setImg").src = "/out/thumb/" + fileNm;
$("setImg").alt = cont;
$("setText").update(cont);
$("popLayer").show();
var iw = $("setImg").width / 2;
var layerLeft = parseInt(( document.body.clientWidth/2 ));
var layerTop = parseInt( document.body.clientHeight/2);
$("popLayer").style.left = 500 - iw;
$("popLayer").style.top = 340 - iw;
}