夜间福利网站,免费动漫av,一级做a爰片久久毛片免费陪,夜夜骑首页,黄色毛片视频,插插插操操操,综合av色

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

時間:2025-12-12 02:52:25 java語言

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

  如何使用JavaScript快速獲取頁面高度寬度呢?大家可以嘗試一下代碼的實現(xiàn),更多詳情請關(guān)注應(yīng)屆畢業(yè)生考試網(wǎng)。

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

  * 取窗口滾動條高度

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

  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;

  }

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

  * 取文檔內(nèi)容實際高度

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

  function getScrollHeight()

  {

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

  }

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

如何使用JavaScript實現(xiàn)頁面定時跳轉(zhuǎn)11-10

JavaScript如何獲取獲取當(dāng)前年月日星期10-21

如何在Word中調(diào)整超過頁面寬度表格02-02

JavaScript如何獲取地址欄中傳遞參數(shù)09-14

如何使用firework設(shè)計網(wǎng)站頁面10-25

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

如何使用JavaScript實現(xiàn)倒計時03-02

dedecms頁面獲取會員狀態(tài)的方法12-12

如何使用php獲取excel文件數(shù)據(jù)08-26