JS 페이지 크기 정보 가 져 오기

1425 단어 JavaScript일 하 다
내 페이지 의 너비 가 보 이 는 너비 보다 커서 내 가 만 든 팝 업 층 의 마스크 는 가로축 을 드래그 할 때 페이지 의 오른쪽 부분 이 한눈 에 들어온다. 문 제 는 내 가 페이지 의 실제 폭 을 얻 지 못 했다 는 것 이다. 그래서 CSDN 에서 JS 가 페이지 크기 를 얻 는 여러 가지 방법 을 찾 았 고 마지막 으로 페이지 를 얻 는 방법 을 document. body. scrollWidth 로 바 꾸 어 문 제 를 해결 했다.
      JS 를 첨부 하여 페이지 크기 를 가 져 오 는 방법:
    
 <script type= "text/javascript " language= "javascript "> 
var s = " "; 
s += "\r
: "+ document.body.clientWidth; s += "\r
: "+ document.body.clientHeight; s += "\r
: "+ document.body.offsetWidth + " ( ) "; s += "\r
: "+ document.body.offsetHeight + " ( ) "; s += "\r
: "+ document.body.scrollWidth; s += "\r
: "+ document.body.scrollHeight; s += "\r
: "+ document.body.scrollTop; s += "\r
: "+ document.body.scrollLeft; s += "\r
: "+ window.screenTop; s += "\r
: "+ window.screenLeft; s += "\r
: "+ window.screen.height; s += "\r
: "+ window.screen.width; s += "\r
: "+ window.screen.availHeight; s += "\r
: "+ window.screen.availWidth; alert(s); </script>

좋은 웹페이지 즐겨찾기