zoukankan      html  css  js  c++  java
  • 兼容的可视区高度和宽度

    function viewWidth(){
        return window.innerWidth || document.documentElement.clientWidth;
    }
    function viewHeight(){
        return window.innerHeight || document.documentElement.clientHeight;
    }

     document.body.clientWidth ==> BODY对象宽度
     document.body.clientHeight ==> BODY对象高度
     document.documentElement.clientWidth ==> 可见区域宽度
     document.documentElement.clientHeight ==> 可见区域高度

      innerWidth&innerHeight

    只读属性,声明了窗口的文档显示区的高度和宽度,以像素计。
    这里的宽度和高度不包括菜单栏、工具栏以及滚动条等的高度。
    居敬持志~ Coding
  • 相关阅读:
    7
    6
    5
    3
    4
    2
    1
    寒假工作经历
    软件工程第三周的总结
    软件工程第三周的学习报告 html<input> final finally finalize 的比较 BigInteger
  • 原文地址:https://www.cnblogs.com/ntscshen/p/4713912.html
Copyright © 2011-2022 走看看