zoukankan      html  css  js  c++  java
  • offset系列,scroll系列

    * 没有脱离文档流
    * offsetLeft:父级元素margin+父级元素padding+父级元素border+自己的margin
    *
    * 脱离文档流
    * 主要是自己的left和自己的margin

    //获取body
    console.log(document.body);//获取的是元素----标签
    //获取title
    console.log(document.title);//标签中的值
    document.title="哈哈哈,你好啊";
    //获取html
    console.log(document.documentElement);




    scrollWidth:元素中内容的实际宽度(不含边框),如果没有内容就说元素的宽
    * scrollHeight:元素中内容的实际高度(不含边框),如果没有内容就说元素的宽
    * scrollTop:向上卷曲出去的距离
    * scrollLft:向左卷曲出去的距离

    //div的滚动事件:时时的获取向上卷曲出去的距离值
    ver("dv").onscroll=function () {
    console.log(this.scrollTop);
    };




    封装scroll函数
    function getscroll() {
    return{
    left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,
    top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0
    };
    }
  • 相关阅读:
    hive 调优
    nohup
    安装ElasticSearch 6.1.1 head插件
    101. Symmetric Tree
    67. Add Binary
    70. Climbing Stairs
    896. Monotonic Array
    66. Plus One
    27. Remove Element
    Apache Tomcat文件包含漏洞风险大,威胁全球约8万台服务器
  • 原文地址:https://www.cnblogs.com/lujieting/p/10055182.html
Copyright © 2011-2022 走看看