av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

java語(yǔ)言

如何使用JavaScript快速獲取頁(yè)面高度寬度

時(shí)間:2025-01-21 15:39:20 java語(yǔ)言 我要投稿
  • 相關(guān)推薦

如何使用JavaScript快速獲取頁(yè)面高度寬度

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

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

  * 取窗口滾動(dò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)容實(shí)際高度

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

  function getScrollHeight()

  {

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

  }

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

如何使用JavaScript實(shí)現(xiàn)頁(yè)面定時(shí)跳轉(zhuǎn)10-18

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

如何在Word中調(diào)整超過(guò)頁(yè)面寬度表格08-13

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

如何使用firework設(shè)計(jì)網(wǎng)站頁(yè)面09-18

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

如何使用JavaScript實(shí)現(xiàn)倒計(jì)時(shí)10-14

dedecms頁(yè)面獲取會(huì)員狀態(tài)的方法10-24

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