팝업창 중앙으로 위치 > script

본문 바로가기
사이트 내 전체검색

script

팝업창 중앙으로 위치

페이지 정보

작성자 서방님 댓글 0건 조회 171회 작성일 08-01-09 15:06

본문

// 팝업창 중앙으로 위치
function center(){
    var x,y;
    if (self.innerHeight) { // IE 외 모든 브라우저
        x = (screen.availWidth - self.innerWidth) / 2;
        y = (screen.availHeight - self.innerHeight) / 2;
    }else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict 모드
        x = (screen.availWidth - document.documentElement.clientWidth) / 2;
        y = (screen.availHeight - document.documentElement.clientHeight) / 2;
    }else if (document.body) { // 다른 IE 브라우저( IE < 6)
        x = (screen.availWidth - document.body.clientWidth) / 2;
        y = (screen.availHeight - document.body.clientHeight) / 2;
    }
    window.moveTo(x,y);
}

팝업 파일의 마지막 하단에
<script type="text/javascript" language="JavaScript">
<!--
center();
//-->
</script>

 

댓글목록

등록된 댓글이 없습니다.

Total 846건 22 페이지
게시물 검색

회원로그인

접속자집계

오늘
24
어제
302
최대
1,347
전체
155,085
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.