메인메뉴 바로가기

HOME으로 가기


내장객체 Screen 객체

페이지 정보

profile_image
작성자 너갱이
댓글 0건 조회 5,280회 작성일 14-11-24 13:59

본문

  • screen.availHeight : 브라우저의 전체 높이

  • screen.availWidth : 브라우저의 전체 너비

  • screen.height : 모니터의 해상도 높이 ",);

  • screen.width : 모니터의 해상도 너비

  •  

  • document.body.clientHeight : 브라우저 안쪽의 높이

  • document.body.clientWidth : 브라우저 안쪽의 너비

  • document.body.scrollHeight : 문서 높이
밤톨넷2012.09.04 13:16:57
 
화면의 폭과 높이는...

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;
}
밤톨넷2012.09.04 13:18:28
 
//screenTop
function closeIt()
{
if (self.screenTop > 9000) {
alert('닫힘'+document.readyState+self.screenTop);
} else {
if(document.readyState == "complete") {
alert('새로고침'+document.readyState+self.screenTop);
} else if(document.readyState == "loading") {
alert('이동'+document.readyState);
}
}

}

 

댓글목록

등록된 댓글이 없습니다.