<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>
            java語言

            如何使用JavaScript快速獲取頁面高度寬度

            時間:2025-01-21 15:39:20 java語言 我要投稿
            • 相關推薦

            如何使用JavaScript快速獲取頁面高度寬度

              如何使用JavaScript快速獲取頁面高度寬度呢?大家可以嘗試一下代碼的實現,更多詳情請關注應屆畢業生考試網。

              /********************

              * 取窗口滾動條高度

              ******************/

              function getScrollTop()

              {

              var scrollTop=0;

              if(document.documentElement&&document.documentElement.scrollTop)

              {

              scrollTop=document.documentElement.scrollTop;

              }

              else if(document.body)

              {

              scrollTop=document.body.scrollTop;

              }

              return scrollTop;

              }

              /********************

              * 取窗口可視范圍的高度

              *******************/

              function getClientHeight()

              {

              var clientHeight=0;

              if(document.body.clientHeight&&document.documentElement.clientHeight)

              {

              var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?docum

              ent.body.clientHeight:document.documentElement.clientHeight;

              }

              else

              {

              var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?docum

              ent.body.clientHeight:document.documentElement.clientHeight;

              }

              return clientHeight;

              }

              /********************

              * 取文檔內容實際高度

              *******************/

              function getScrollHeight()

              {

              return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);

              }

            【如何使用JavaScript快速獲取頁面高度寬度】相關文章:

            如何使用JavaScript實現頁面定時跳轉10-18

            JavaScript如何獲取獲取當前年月日星期06-04

            如何在Word中調整超過頁面寬度表格08-13

            JavaScript如何獲取地址欄中傳遞參數10-06

            如何使用firework設計網站頁面09-18

            如何快速獲取2017年考研信息與資料08-08

            如何使用JavaScript實現倒計時10-14

            dedecms頁面獲取會員狀態的方法10-24

            如何使用php獲取excel文件數據10-17

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看