zoukankan      html  css  js  c++  java
  • offset

    offsetParent(父级元素position是relative或absolute)

    width/height(内容的宽高)

    clientWidth=width+paddingleft+paddingright

    clientHeight=height+paddingtop+paddingbottom

    offsetWidth=width+paddingleft+paddingright+borderleft+borderright

    offsetheight=height+paddingtop+paddingbottom+bordertop+borderbottom

    offsetLeft=(offsetParent的padding-left)+(中间元素的offsetWidth)+(当前元素的margin-left)。

    offsetTop=(offsetParent的padding-top)+(中间元素的offsetHeight)+(当前元素的margin-top)。

    //jquery 对css的控制

    $('#divid').css('propertyName') //get property value

    $('#divid').css('propertyName','value') //set property value

    $('#divid').offset().top  //相对于浏览器

    $('#divid').offset().left

    $('#divid').position().top  //相对于最近设置过position的元素

    $('#divid').position().left

    $('#divid').scrollTop(offset)  //返回或设置

    $('#divid').height()  //content height

    $('#divid').outerHeight()  //等于offsetheight   outerHeight(true)=offsetheight+margin

    $(window).height()  //浏览器高度

    $('#divid').css('cssText')   //var csstxt = $('#selector').css('cssText') + ';top:100;left:100;border:1px solid red;color:#f00;';$('#selector').css('cssText', csstxt);

  • 相关阅读:
    Rabbitmq的使用四_Java Client方式使用Topic模式
    CentOS7安装Redis
    nmon文件结果分析
    nmon安装
    jmeter+ant+jenkins
    jenkins插件下载加速
    jmeter:多机联合负载
    jmeter Linux负载机出错Server failed to start:
    jenkins安装
    fiddler:筛选请求响应
  • 原文地址:https://www.cnblogs.com/yfann/p/4753394.html
Copyright © 2011-2022 走看看