zoukankan      html  css  js  c++  java
  • jquery获取网页在浏览器中可见宽度与高度

    jquery获取网页在浏览器中可见宽度与高度

    // 部分jQuery函数  
    $(window).height()                //浏览器时下窗口可视区域高度   
    $(document).height()            //浏览器时下窗口文档的高度   
    $(document.body).height()      //浏览器时下窗口文档body的高度   
    $(document.body).outerHeight(true) //浏览器时下窗口文档body的总高度 包括border padding margin   
    $(window).width()     //浏览器时下窗口可视区域宽度   
    $(document).width()   //浏览器时下窗口文档对于象宽度   
    $(document.body).width()      //浏览器时下窗口文档body的高度   
    $(document.body).outerWidth(true) //浏览器时下窗口文档body的总宽度 包括border padding

    以下是JS的代码

    document.body.clientWidth ==> BODY对象宽度
    document.body.clientHeight ==> BODY对象高度
    document.documentElement.clientWidth ==> 可见区域宽度
    document.documentElement.clientHeight ==> 可见区域高度
      
    document.body.clientWidth ==> 网页可见区域宽 
    document.body.clientHeight ==> 网页可见区域高
    document.body.offsetWidth ==> 网页可见区域宽(包括边线的宽)
    document.body.offsetHeight ==> 网页可见区域高(包括边线的高)
    document.body.scrollWidth ==> 网页正文全文宽document.body.scrollHeight ==> 网页正文全文高
    document.body.scrollTop ==> 网页被卷去的高
    document.body.scrollLeft ==> 网页被卷去的左
    window.screenTop ==> 网页正文部分上
    window.screenLeft ==> 网页正文部分左
    window.screen.height ==> 屏幕分辨率的高
    window.screen.width ==> 屏幕可用工作区高度
    window.screen.availHeight ==> 屏幕可用工作区高度
    window.screen.availWidth ==> 屏幕可用工作区宽度
  • 相关阅读:
    BNU 51002 BQG's Complexity Analysis
    BNU OJ 51003 BQG's Confusing Sequence
    BNU OJ 51000 BQG's Random String
    BNU OJ 50999 BQG's Approaching Deadline
    BNU OJ 50998 BQG's Messy Code
    BNU OJ 50997 BQG's Programming Contest
    CodeForces 609D Gadgets for dollars and pounds
    CodeForces 609C Load Balancing
    CodeForces 609B The Best Gift
    CodeForces 609A USB Flash Drives
  • 原文地址:https://www.cnblogs.com/phpyangbo/p/12550345.html
Copyright © 2011-2022 走看看