zoukankan      html  css  js  c++  java
  • js兼容

    一、获取计算后的样式,也叫当前样式、最终样式。

      currentStyle     VS     getComputedStyle

    let oObj = document.getElementById("div");
    function isStyle (oObj,oStyle) {
        if (oObj.currentStyle) {
            //IE、Opera
            return oObj.currentStyle[oStyle];
        } else {
            //FF、chrome、safari
            return window.getComputedStyle(oObj,false)[oStyle];
        }
    }
    View Code

     http://www.mming.cc/blog/?p=549https://www.cnblogs.com/leejersey/archive/2012/08/16/2642604.html

    二、document.body    VS    document.documentElement

    let a = document.body.scrollWidth || document.documentElement.scrollWidth,

         b = document.body.scrollHeight || document.documentElement.scrollHeight;

    https://blog.csdn.net/qq_26445509/article/details/51153153

    https://www.cnblogs.com/lidabo/archive/2012/04/27/2473084.html

  • 相关阅读:
    Linux排序命令sort笔记
    Linux排序命令sort笔记
    Linux文本截取命令cut​笔记
    排序和搜索
    栈和队列
    链表
    顺序表
    Linux编辑器|gedit|vi|vim编辑器
    Linux简介
    简单学习Git
  • 原文地址:https://www.cnblogs.com/lgyong/p/9245797.html
Copyright © 2011-2022 走看看