zoukankan      html  css  js  c++  java
  • 各种浏览器高度

    各种浏览器高度:

    obj.clientHeight; //本身的高度+padding
    obj.offsetHeight; //包含边框的高+padding+border
    
    document.body.clientHeight //body的高
    document.documentElement.clientHeight  //可视区域即一个屏幕的高:documentElement=html
    document.documentElement.scrollHeight //出现滚动条的高
    document.documentElement.scrollTop //已经滚动了多高
    //document.body.scrollTop //google兼容写法
    
    
    obj.offsetLeft:当前元素到父级的偏移距离;
    如果有定位父级
    ie7下:如果自身没有定位,默认是到body;
    其它:到定位父级的距离;
    
    如果没有定位父级
    offsetParent ->body
    offsetLeft -> html
    
    
    obj.style.样式宽=content
    obj.clientWidth:可视宽=content+padding
    obj.offsetWidth:占位宽=content+padding+border
  • 相关阅读:
    1046 A^B Mod C
    1019 逆序数
    1012 最小公倍数LCM
    1011 最大公约数GCD
    序列化
    bigdecimal
    equals 和hashcode
    java多线程-读写锁原理
    Java并发编程:volatile关键字解析
    面试
  • 原文地址:https://www.cnblogs.com/lisa2544/p/5512412.html
Copyright © 2011-2022 走看看